[x] 'test/save-article-without-url.php' [ ] test/save-article.php -------------------------------------------------------------------------------- int(255) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Option 'url' must have a value' in /p/vendor/augustohp/getopt-php/src/CommandLineParser.php:16 ———————————————————————————————————————— Executed in 2.907382 seconds. 5 total tests, with 4 successes and 1 failures.
[x] 'test/save-article-without-url.php' [ ] test/save-article.php -------------------------------------------------------------------------------- int(255) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Option 'url' must have a value' in /p/vendor/augustohp/getopt-php/src/CommandLineParser.php:16 ———————————————————————————————————————— Executed in 2.907382 seconds. 5 total tests, with 4 successes and 1 failures. TESTE ZUADO
[x] 'test/save-article-without-url.php' [ ] test/save-article.php -------------------------------------------------------------------------------- int(255) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Option 'url' must have a value' in /p/vendor/augustohp/getopt-php/src/CommandLineParser.php:16 ———————————————————————————————————————— Executed in 2.907382 seconds. 5 total tests, with 4 successes and 1 failures. EXIT CODE DO COMANDO
[x] 'test/save-article-without-url.php' [ ] test/save-article.php -------------------------------------------------------------------------------- int(255) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Option 'url' must have a value' in /p/vendor/augustohp/getopt-php/src/CommandLineParser.php:16 ———————————————————————————————————————— Executed in 2.907382 seconds. 5 total tests, with 4 successes and 1 failures. TIPO DE ERRO
[x] 'test/save-article-without-url.php' [ ] test/save-article.php -------------------------------------------------------------------------------- int(255) Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Option 'url' must have a value' in /p/vendor/augustohp/getopt-php/src/CommandLineParser.php:16 ———————————————————————————————————————— Executed in 2.907382 seconds. 5 total tests, with 4 successes and 1 failures. OLHA MÃE! NÓIS DEBUGANDO
= ''; 8 9 final public function setUp() 10 { 26 } 27 28 protected function renderCommand($command) 29 { 30 return 'php ' . $this->programPath . ' ' . $command; 31 } 32 37 public function init() 38 { 39 } 40 } RETORNA O COMANDO A SER EXECUTADO COM O PATH CERTO
*/ 50 public function saveArticleWithInvalidUrl($url) 51 { 67 } 68 69 public function provideInvalidUrl() 70 { 71 return [ 72 "Only protocol" => ["http://"], 73 ]; 74 } CONECTA O TESTE AO DATA PROVIDER
*/ 50 public function saveArticleWithInvalidUrl($url) 51 { 67 } 68 69 public function provideInvalidUrl() 70 { 71 return [ 72 "Only protocol" => ["http://"], 73 ]; 74 } UM CENÁRIO = UMA EXECUÇÃO DO TESTE
Runtime: PHP 5.6.26 5 Configuration: /p/phpunit.xml.dist 6 7 Pascutti\ReadingDump\Example 8 [x] Successfull readme example execution 9 10 Pascutti\ReadingDump\RetrieveArticles 11 [x] Without arguments execute successfully 12 13 Pascutti\ReadingDump\SaveArticle 14 [x] Successfull article adition 15 [x] Save article without url argument fails 16 [x] Save article with invalid url fails because of only having protocol 17 [x] Save article with invalid url fails because of not having protocol 18 [x] Save article with invalid url fails because of being empty 19 20 Pascutti\ReadingDump\TagArticle 21 [x] Successfull article tag
Runtime: PHP 5.6.26 5 Configuration: /p/phpunit.xml.dist 6 7 Pascutti\ReadingDump\Example 8 [x] Successfull readme example execution 9 10 Pascutti\ReadingDump\RetrieveArticles 11 [x] Without arguments execute successfully 12 13 Pascutti\ReadingDump\SaveArticle 14 [x] Successfull article adition 15 [x] Save article without url argument fails 16 [x] Save article with invalid url fails because of only having protocol 17 [x] Save article with invalid url fails because of not having protocol 18 [x] Save article with invalid url fails because of being empty 19 20 Pascutti\ReadingDump\TagArticle 21 [x] Successfull article tag CLASSE
Runtime: PHP 5.6.26 5 Configuration: /p/phpunit.xml.dist 6 7 Pascutti\ReadingDump\Example 8 [x] Successfull readme example execution 9 10 Pascutti\ReadingDump\RetrieveArticles 11 [x] Without arguments execute successfully 12 13 Pascutti\ReadingDump\SaveArticle 14 [x] Successfull article adition 15 [x] Save article without url argument fails 16 [x] Save article with invalid url fails because of only having protocol 17 [x] Save article with invalid url fails because of not having protocol 18 [x] Save article with invalid url fails because of being empty 19 20 Pascutti\ReadingDump\TagArticle 21 [x] Successfull article tag NOME DO TESTE
Runtime: PHP 5.6.26 5 Configuration: /p/phpunit.xml.dist 6 7 Pascutti\ReadingDump\Example 8 [x] Successfull readme example execution 9 10 Pascutti\ReadingDump\RetrieveArticles 11 [x] Without arguments execute successfully 12 13 Pascutti\ReadingDump\SaveArticle 14 [x] Successfull article adition 15 [x] Save article without url argument fails 16 [x] Save article with invalid url fails because of only having protocol 17 [x] Save article with invalid url fails because of not having protocol 18 [x] Save article with invalid url fails because of being empty 19 20 Pascutti\ReadingDump\TagArticle 21 [x] Successfull article tag STATUS
Runtime: PHP 5.6.26 5 Configuration: /p/phpunit.xml.dist 6 7 Pascutti\ReadingDump\Example 8 [x] Successfull readme example execution 9 10 Pascutti\ReadingDump\RetrieveArticles 11 [x] Without arguments execute successfully 12 13 Pascutti\ReadingDump\SaveArticle 14 [x] Successfull article adition 15 [x] Save article without url argument fails 16 [x] Save article with invalid url fails because of only having protocol 17 [x] Save article with invalid url fails because of not having protocol 18 [x] Save article with invalid url fails because of being empty 19 20 Pascutti\ReadingDump\TagArticle 21 [x] Successfull article tag NOME DO TESTE
Runtime: PHP 5.6.26 5 Configuration: /p/phpunit.xml.dist 6 7 Pascutti\ReadingDump\Example 8 [x] Successfull readme example execution 9 10 Pascutti\ReadingDump\RetrieveArticles 11 [x] Without arguments execute successfully 12 13 Pascutti\ReadingDump\SaveArticle 14 [x] Successfull article adition 15 [x] Save article without url argument fails 16 [x] Save article with invalid url fails because of only having protocol 17 [x] Save article with invalid url fails because of not having protocol 18 [x] Save article with invalid url fails because of being empty 19 20 Pascutti\ReadingDump\TagArticle 21 [x] Successfull article tag DATA PROVIDER
= new PocketArticle( 14 $id, 15 $createdAt, 16 $wordCount 17 ); 18 19 $this->assertInstanceOf( 20 PocketArticle::class, 21 $article 22 ); 23 $this->assertEquals( 24 $id, 25 $article->id(), 26 "The ID of the article should be the same one given upon instantiation." 27 ); 28 $this->assertEquals( 29 $createdAt, 30 $article->createdAt()->format('U'), 31 "When the article was saved must be always presented through a DateTime instance." 32 ); 33 $this->assertEquals( 34 (int) $wordCount, 35 $article->wordCount(), 36 "The 'word count' of the article should be the same one given upon instantiation." 37 ); 38 } 39 ISSO É O QUE TÍNHAMOS
= new PocketArticle( 14 $id, 15 $createdAt, 16 $wordCount 17 ); 18 19 $this->assertInstanceOf( 20 PocketArticle::class, 21 $article 22 ); 23 $this->assertEquals( 24 $id, 25 $article->id(), 26 "The ID of the article should be the same one given upon instantiation." 27 ); 28 $this->assertEquals( 29 $createdAt, 30 $article->createdAt()->format('U'), 31 "When the article was saved must be always presented through a DateTime instance." 32 ); 33 $this->assertEquals( 34 (int) $wordCount, 35 $article->wordCount(), 36 "The 'word count' of the article should be the same one given upon instantiation." 37 ); 38 } 39 NOVAS VERIFICAÇÕES
of the article should be the same one given upon instantiation." 27 ); 28 $this->assertEquals( 29 $createdAt, 30 $article->createdAt()->format('U'), 31 "When the article was saved must be always presented through a DateTime instance." 32 ); 33 $this->assertEquals( 34 (int) $wordCount, 35 $article->wordCount(), 36 "The 'word count' of the article should be the same one given upon instantiation." 37 ); 38 } 39
of the article should be the same one given upon instantiation." 27 ); 28 $this->assertEquals( 29 $createdAt, 30 $article->createdAt()->format('U'), 31 "When the article was saved must be always presented through a DateTime instance." 32 ); 33 $this->assertEquals( 34 (int) $wordCount, 35 $article->wordCount(), 36 "The 'word count' of the article should be the same one given upon instantiation." 37 ); 38 } 39
of the article should be the same one given upon instantiation." 27 ); 28 $this->assertEquals( 29 $createdAt, 30 $article->createdAt()->format('U'), 31 "When the article was saved must be always presented through a DateTime instance." 32 ); 33 $this->assertEquals( 34 (int) $wordCount, 35 $article->wordCount(), 36 "The 'word count' of the article should be the same one given upon instantiation." 37 ); 38 } 39
Runtime: PHP 5.6.26 4 Configuration: /p/phpunit.xml.dist 5 6 FIII 4 / 4 (100%) 7 8 Time: 26 ms, Memory: 3.50MB 9 10 There was 1 failure: 11 12 1) Pascutti\ReadingDump\PocketArticleTest::successfullInstantiationWith with data set "every information possible" ('123456', '1503855225', 650) 13 The ID of the article should be the same one given upon instantiation. 14 Failed asserting that two strings are equal. 15 --- Expected 16 +++ Actual 17 @@ @@ 18 -'123456' 19 +'' 20 21 /p/test/unit/PocketArticleTest.php:27 39 FAILURES! 40 Tests: 4, Assertions: 2, Failures: 1, Incomplete: 3.
Runtime: PHP 5.6.26 4 Configuration: /p/phpunit.xml.dist 5 6 FIII 4 / 4 (100%) 7 8 Time: 26 ms, Memory: 3.50MB 9 10 There was 1 failure: 11 12 1) Pascutti\ReadingDump\PocketArticleTest::successfullInstantiationWith with data set "every information possible" ('123456', '1503855225', 650) 13 The ID of the article should be the same one given upon instantiation. 14 Failed asserting that two strings are equal. 15 --- Expected 16 +++ Actual 17 @@ @@ 18 -'123456' 19 +'' 20 21 /p/test/unit/PocketArticleTest.php:27 39 FAILURES! 40 Tests: 4, Assertions: 2, Failures: 1, Incomplete: 3.
Runtime: PHP 5.6.26 4 Configuration: /p/phpunit.xml.dist 5 6 Pascutti\ReadingDump\PocketArticle 7 [x] Successfull instantiation with every information possible 8 [x] Successfull instantiation with maximum integer value for word count 9 [x] Successfull instantiation with with one tag 10 [x] Failed instantiation with invalid creation date 11 [x] Successfull pocket article url guessing through article id 12 [x] Successfull serialization to cli line 13 [x] Successfully assert tag is present and is the only one on article 14 [x] Successfully assert tag is present and is the among many on article 15 [x] Successfully assert tag is not present on article without tags
@test 39 */ 40 public function failToSaveArticleForServerError() 41 { 42 $this->mockApi->method('add') 43 ->will($this->throwException(new PocketException)); 44 45 $this->expectException(PocketException::class); 46 47 $this->pocket->saveArticle('aaa', 'bbbb'); 48 } 49 } O QUE ELE VAI FAZER
@test 39 */ 40 public function failToSaveArticleForServerError() 41 { 42 $this->mockApi->method('add') 43 ->will($this->throwException(new PocketException)); 44 45 $this->expectException(PocketException::class); 46 47 $this->pocket->saveArticle('aaa', 'bbbb'); 48 } 49 } O NOVO MEMBRO DA FAMÍLIA
Runtime: PHP 5.6.26 4 Configuration: /p/phpunit.xml.dist 5 6 Pascutti\ReadingDump\Example 7 [x] Successfull readme example execution 8 9 Pascutti\ReadingDump\RetrieveArticles 10 [x] Without arguments execute successfully 11 12 Pascutti\ReadingDump\SaveArticle 13 [x] Successfull article adition 14 [x] Save article without url argument fails 15 [x] Save article with invalid url fails because of only having protocol 16 [x] Save article with invalid url fails because of not having protocol 17 [x] Save article with invalid url fails because of being empty 18 19 Pascutti\ReadingDump\TagArticle 20 [x] Successfull article tag 21 22 Pascutti\ReadingDump\PocketArticle 23 [x] Successfull instantiation with every information possible 24 [x] Successfull instantiation with maximum integer value for word count 25 [x] Successfull instantiation with with one tag 26 [x] Failed instantiation with invalid creation date 27 [x] Successfull pocket article url guessing through article id 28 [x] Successfull serialization to cli line 29 [x] Successfully assert tag is present and is the only one on article 30 [x] Successfully assert tag is present and is the among many on article 31 [x] Successfully assert tag is not present on article without tags 32 33 Pascutti\ReadingDump\PocketService 34 [x] Successfully saving article 35 [x] Fail to save article without url 36 [x] Fail to save article for server error