Slide 265
Slide 265 text
11 public function successfullInstantiationWith($id, $createdAt, $wordCount)
12 {
13 $article = 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