public function testInheritence() { $post1 = Post::find(1); $post2 = BlogPost::find(1); $this->assertSame($post1, $post2); }
/** * @covers ::isModel */ public function testIsModel() { $postConfig = Post::getRepo()->getConfig(); $blogPostConfig = BlogPost::getRepo()->getConfig(); $post = new Post(); $blogPost = new BlogPost(); $this->assertTrue($postConfig->isModel($post)); $this->assertTrue($postConfig->isModel($blogPost)); $this->assertTrue($blogPostConfig->isModel($post)); $this->assertTrue($blogPostConfig->isModel($blogPost)); $city = new City(); $this->assertFalse($postConfig->isModel($city)); }
/** * @covers ::getRootRepo */ public function testGetRootRepo() { $this->assertSame(Post::getRepo(), Post::getRepo()->getRootRepo()); $this->assertSame(Post::getRepo(), BlogPost::getRepo()->getRootRepo()); }