public function testHas() { $book = new Book($this->conn); $this->assertFalse($book->has('name')); $book->setRaw('name', 'foo'); $this->assertTrue($book->has('name')); //not a column $this->assertFalse($book->has('something')); $book->setRaw('something', 'foo'); $this->assertTrue($book->has('something')); //related object $details = new BookDetails($this->conn); $book->setRelation('details', $details); $this->assertTrue($book->has('details')); //related object collection, but empty $books = new EntityCollection(); $author = new Author($this->conn); $author->setRelation('books', $books); $this->assertFalse($author->has('books')); //object collection containing entities $books[] = $book; $this->assertTrue($author->has('books')); }