From 07164b27399738d36b306297e3f16f2f42dcbe1c Mon Sep 17 00:00:00 2001 From: Sara Bine Date: Wed, 5 Apr 2017 17:43:40 -0600 Subject: [PATCH 1/4] Fix argument order in assertEquals Correct order is ($expected, $actual) --- Behavioral/Command/Tests/CommandTest.php | 2 +- Behavioral/Command/Tests/UndoableCommandTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Behavioral/Command/Tests/CommandTest.php b/Behavioral/Command/Tests/CommandTest.php index fa2e835..2479321 100644 --- a/Behavioral/Command/Tests/CommandTest.php +++ b/Behavioral/Command/Tests/CommandTest.php @@ -16,6 +16,6 @@ class CommandTest extends TestCase $invoker->setCommand(new HelloCommand($receiver)); $invoker->run(); - $this->assertEquals($receiver->getOutput(), 'Hello World'); + $this->assertEquals('Hello World', $receiver->getOutput()); } } diff --git a/Behavioral/Command/Tests/UndoableCommandTest.php b/Behavioral/Command/Tests/UndoableCommandTest.php index 708c736..9569cb1 100644 --- a/Behavioral/Command/Tests/UndoableCommandTest.php +++ b/Behavioral/Command/Tests/UndoableCommandTest.php @@ -17,17 +17,17 @@ class UndoableCommandTest extends TestCase $invoker->setCommand(new HelloCommand($receiver)); $invoker->run(); - $this->assertEquals($receiver->getOutput(), 'Hello World'); + $this->assertEquals('Hello World', $receiver->getOutput()); $messageDateCommand = new AddMessageDateCommand($receiver); $messageDateCommand->execute(); $invoker->run(); - $this->assertEquals($receiver->getOutput(), "Hello World\nHello World [".date('Y-m-d').']'); + $this->assertEquals("Hello World\nHello World [".date('Y-m-d').']', $receiver->getOutput()); $messageDateCommand->undo(); $invoker->run(); - $this->assertEquals($receiver->getOutput(), "Hello World\nHello World [".date('Y-m-d')."]\nHello World"); + $this->assertEquals("Hello World\nHello World [".date('Y-m-d')."]\nHello World", $receiver->getOutput()); } } From 8d73f125ee341f1ac371b391f0d499f4ba58f231 Mon Sep 17 00:00:00 2001 From: Sara Bine Date: Wed, 5 Apr 2017 17:44:28 -0600 Subject: [PATCH 2/4] Fix RepositoryTest class name --- More/Repository/Tests/RepositoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/More/Repository/Tests/RepositoryTest.php b/More/Repository/Tests/RepositoryTest.php index c3b77c9..9bd2b80 100644 --- a/More/Repository/Tests/RepositoryTest.php +++ b/More/Repository/Tests/RepositoryTest.php @@ -7,7 +7,7 @@ use DesignPatterns\More\Repository\Post; use DesignPatterns\More\Repository\PostRepository; use PHPUnit\Framework\TestCase; -class Repository extends TestCase +class RepositoryTest extends TestCase { public function testCanPersistAndFindPost() { From b5a7241f494d14874776177f5267fabe31ffa29d Mon Sep 17 00:00:00 2001 From: Sara Bine Date: Wed, 5 Apr 2017 17:45:13 -0600 Subject: [PATCH 3/4] Fix some mismatched & unescaped quotes --- locale/pt_BR/LC_MESSAGES/Behavioral/Iterator/README.po | 2 +- locale/template/LC_MESSAGES/Creational/FactoryMethod/README.pot | 2 +- locale/template/LC_MESSAGES/Creational/Pool/README.pot | 2 +- locale/zh_CN/LC_MESSAGES/Behavioral/Iterator/README.po | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR/LC_MESSAGES/Behavioral/Iterator/README.po b/locale/pt_BR/LC_MESSAGES/Behavioral/Iterator/README.po index 7833fbf..25ccf3a 100644 --- a/locale/pt_BR/LC_MESSAGES/Behavioral/Iterator/README.po +++ b/locale/pt_BR/LC_MESSAGES/Behavioral/Iterator/README.po @@ -20,7 +20,7 @@ msgid "Purpose" msgstr "" #: ../../Behavioral/Iterator/README.rst:7 -msgid To make an object iterable and to make it appear like a collection of objects." +msgid "To make an object iterable and to make it appear like a collection of objects." msgstr "" #: ../../Behavioral/Iterator/README.rst:11 diff --git a/locale/template/LC_MESSAGES/Creational/FactoryMethod/README.pot b/locale/template/LC_MESSAGES/Creational/FactoryMethod/README.pot index 1a91a9f..2cf0eb8 100644 --- a/locale/template/LC_MESSAGES/Creational/FactoryMethod/README.pot +++ b/locale/template/LC_MESSAGES/Creational/FactoryMethod/README.pot @@ -29,7 +29,7 @@ msgstr "" #: ../../Creational/FactoryMethod/README.rst:12 msgid "" "This pattern is a \"real\" Design Pattern because it achieves the " -"Dependency Inversion Principle" a.k.a the "D" in S.O.L.I.D principles." +"\"Dependency Inversion Principle\" a.k.a the \"D\" in S.O.L.I.D principles." msgstr "" #: ../../Creational/FactoryMethod/README.rst:15 diff --git a/locale/template/LC_MESSAGES/Creational/Pool/README.pot b/locale/template/LC_MESSAGES/Creational/Pool/README.pot index d21d897..b8f06f2 100644 --- a/locale/template/LC_MESSAGES/Creational/Pool/README.pot +++ b/locale/template/LC_MESSAGES/Creational/Pool/README.pot @@ -19,7 +19,7 @@ msgstr "" #: ../../Creational/Pool/README.rst:7 msgid "" "The **object pool pattern** is a software creational design pattern that " -"uses a set of initialized objects kept ready to use – a "pool" – rather " +"uses a set of initialized objects kept ready to use – a \"pool\" – rather " "than allocating and destroying them on demand. A client of the pool will " "request an object from the pool and perform operations on the returned " "object. When the client has finished, it returns the object, which is a " diff --git a/locale/zh_CN/LC_MESSAGES/Behavioral/Iterator/README.po b/locale/zh_CN/LC_MESSAGES/Behavioral/Iterator/README.po index 7833fbf..25ccf3a 100644 --- a/locale/zh_CN/LC_MESSAGES/Behavioral/Iterator/README.po +++ b/locale/zh_CN/LC_MESSAGES/Behavioral/Iterator/README.po @@ -20,7 +20,7 @@ msgid "Purpose" msgstr "" #: ../../Behavioral/Iterator/README.rst:7 -msgid To make an object iterable and to make it appear like a collection of objects." +msgid "To make an object iterable and to make it appear like a collection of objects." msgstr "" #: ../../Behavioral/Iterator/README.rst:11 From 7b90f0887718f96af693a7371862f3fa2b3a1626 Mon Sep 17 00:00:00 2001 From: Sara Bine Date: Wed, 5 Apr 2017 17:47:02 -0600 Subject: [PATCH 4/4] Fix method name: providateDates > provideDates --- Behavioral/Strategy/Tests/StrategyTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Behavioral/Strategy/Tests/StrategyTest.php b/Behavioral/Strategy/Tests/StrategyTest.php index a310910..cf1f7f3 100644 --- a/Behavioral/Strategy/Tests/StrategyTest.php +++ b/Behavioral/Strategy/Tests/StrategyTest.php @@ -23,7 +23,7 @@ class StrategyTest extends TestCase ]; } - public function providateDates() + public function provideDates() { return [ [ @@ -54,7 +54,7 @@ class StrategyTest extends TestCase } /** - * @dataProvider providateDates + * @dataProvider provideDates * * @param array $collection * @param array $expected