public function testConstructor() { $tagging = new Tagging(); $this->assertNull($tagging->getId()); $this->assertEquals(new \DateTime('now'), $tagging->getCreatedAt()); $this->assertEquals(new \DateTime('now'), $tagging->getUpdatedAt()); $tag = new Tag('Smallville'); $article = new Article(); $article->setTitle('Hello World!'); $article->id = 123; $tagging = new Tagging($tag, $article); $this->assertEquals($article->getTaggableType(), $tagging->getResourceType()); $this->assertEquals($article->getTaggableId(), $tagging->getResourceId()); $this->assertEquals($tag, $tagging->getTag()); }