diff --git a/tests/ArgumentTest.php b/tests/Argument/ArgumentTest.php similarity index 99% rename from tests/ArgumentTest.php rename to tests/Argument/ArgumentTest.php index 59a25fea..89d9d22c 100644 --- a/tests/ArgumentTest.php +++ b/tests/Argument/ArgumentTest.php @@ -1,10 +1,11 @@ drawWorks(); - $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . 'art'); + $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'art'); $this->cli->draw('works'); } @@ -84,7 +86,7 @@ public function it_can_take_a_custom_art_directory() public function it_can_take_a_custom_art_directory_with_a_trailing_slash() { $this->drawWorks(); - $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . 'art' . \DIRECTORY_SEPARATOR); + $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'art' . \DIRECTORY_SEPARATOR); $this->cli->draw('works'); } @@ -95,7 +97,7 @@ public function it_can_take_a_custom_art_directory_with_a_trailing_slash() public function it_can_chain_the_art_setting() { $this->drawWorks(); - $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . 'art')->draw('works'); + $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'art')->draw('works'); } @@ -110,7 +112,7 @@ public function testAddArt1() $this->shouldWrite("\e[m\e[0m"); $this->shouldHavePersisted(); - $this->cli->addArt(__DIR__ . "/art/"); + $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . "art/"); $this->cli->draw("art"); } diff --git a/tests/DumpTest.php b/tests/TerminalObject/Basic/DumpTest.php similarity index 78% rename from tests/DumpTest.php rename to tests/TerminalObject/Basic/DumpTest.php index ed9a7865..d386c2a3 100644 --- a/tests/DumpTest.php +++ b/tests/TerminalObject/Basic/DumpTest.php @@ -1,6 +1,8 @@ "Cell 1", - "cell2" => "Cell 2", - "cell3" => "Cell 3", - "cell4" => "Cell 4", - ], \JSON_PRETTY_PRINT); + $should_be = json_encode((object) [ + 'cell1' => 'Cell 1', + 'cell2' => 'Cell 2', + 'cell3' => 'Cell 3', + 'cell4' => 'Cell 4', + ], JSON_PRETTY_PRINT); - $this->shouldWrite("\e[m{$json}\e[0m"); + $this->shouldWrite("\e[m" . $should_be . "\e[0m"); $this->shouldHavePersisted(); $this->cli->json((object) [ - "cell1" => "Cell 1", - "cell2" => "Cell 2", - "cell3" => "Cell 3", - "cell4" => "Cell 4", - ]); + 'cell1' => 'Cell 1', + 'cell2' => 'Cell 2', + 'cell3' => 'Cell 3', + 'cell4' => 'Cell 4', + ]); } /** * We do this test specifically because json escapes the tags, - * we want to make sure we"re taking care of that + * we want to make sure we're taking care of that * * @test * @doesNotPerformAssertions */ public function it_can_output_json_with_tags() { - $json = json_encode((object) [ - "cell1" => "Cell 1", - "cell2" => "Cell 2", - "cell3" => "Cell 3", - "cell4" => "Cell 4", + $should_be = json_encode((object) [ + "cell1" => 'Cell 1', + "cell2" => 'Cell 2', + "cell3" => 'Cell 3', + "cell4" => 'Cell 4', ], \JSON_PRETTY_PRINT); - $json = str_replace("Cell 4", "\e[5mCell 4\e[0m", $json); + $should_be = str_replace('Cell 4', "\e[5mCell 4\e[0m", $should_be); - $this->shouldWrite("\e[m{$json}\e[0m"); + $this->shouldWrite("\e[m" . $should_be . "\e[0m"); $this->shouldHavePersisted(); $this->cli->json((object) [ diff --git a/tests/TabTest.php b/tests/TerminalObject/Basic/TabTest.php similarity index 94% rename from tests/TabTest.php rename to tests/TerminalObject/Basic/TabTest.php index f72f68d5..0d229575 100644 --- a/tests/TabTest.php +++ b/tests/TerminalObject/Basic/TabTest.php @@ -1,6 +1,8 @@ cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'art'); + $this->cli->addArt(__DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'art'); } - protected function emptyFrame() { $this->shouldWrite("\e[m\e[0m")->ordered(); diff --git a/tests/Animation/ExitToBottomFrames.php b/tests/TerminalObject/Dynamic/Animation/ExitToBottomFrames.php similarity index 98% rename from tests/Animation/ExitToBottomFrames.php rename to tests/TerminalObject/Dynamic/Animation/ExitToBottomFrames.php index 88f3bd7c..a5dbe6b2 100644 --- a/tests/Animation/ExitToBottomFrames.php +++ b/tests/TerminalObject/Dynamic/Animation/ExitToBottomFrames.php @@ -1,6 +1,6 @@