Pheasant\Tests\DomainObjectTest::testDefaultProperties PHP Method

testDefaultProperties() public method

    public function testDefaultProperties()
    {
        $animal = new Animal();
        $this->assertEquals($animal->type, 'llama');
        $this->assertEquals($animal->toArray(), array('id' => NULL, 'type' => 'llama', 'name' => null));
        $llama = new Animal(array('type' => 'llama'));
        $frog = new Animal(array('type' => 'frog'));
        $this->assertTrue($llama->equals($animal));
        $this->assertFalse($llama->equals($frog));
    }