1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace League\CLImate\Tests\TerminalObject\Basic;
- use League\CLImate\Tests\TestBase;
- class TabTest extends TestBase
- {
- /**
- * @test
- * @doesNotPerformAssertions
- */
- public function it_can_output_a_tab()
- {
- $this->output->shouldReceive("sameLine");
- $this->shouldWrite("\e[m\t\e[0m");
- $this->shouldHavePersisted();
- $this->cli->tab();
- }
- /**
- * @test
- * @doesNotPerformAssertions
- */
- public function it_is_chainable()
- {
- $this->output->shouldReceive("sameLine");
- $this->shouldWrite("\e[m\t\e[0m");
- $this->shouldWrite("\e[mThis is indented.\e[0m");
- $this->shouldHavePersisted(2);
- $this->cli->tab()->out('This is indented.');
- }
- /**
- * @test
- * @doesNotPerformAssertions
- */
- public function it_can_accept_the_number_of_tabs_as_an_argument()
- {
- $this->output->shouldReceive("sameLine");
- $this->shouldWrite("\e[m\t\t\t\e[0m");
- $this->shouldWrite("\e[mThis is really indented.\e[0m");
- $this->shouldHavePersisted(2);
- $this->cli->tab(3)->out('This is really indented.');
- }
- /**
- * @test
- * @doesNotPerformAssertions
- */
- public function it_will_ignore_a_negative_number_of_tabs()
- {
- $this->output->shouldReceive("sameLine");
- $this->shouldWrite("\e[m\t\e[0m");
- $this->shouldHavePersisted();
- $this->cli->tab(-3);
- }
- /**
- * @test
- * @doesNotPerformAssertions
- */
- public function it_will_ignore_a_partial_number_of_tabs()
- {
- $this->output->shouldReceive("sameLine");
- $this->shouldWrite("\e[m\t\t\e[0m");
- $this->shouldHavePersisted();
- $this->cli->tab(2.7);
- }
- }
|