[PHP] Fix default values in derived classes

Fixes flaw in 9f40a82310.
This commit is contained in:
Arne Jørgensen
2016-05-06 23:36:49 +02:00
parent 34ec63e908
commit f5a802d9af
3 changed files with 33 additions and 17 deletions

View File

@@ -450,6 +450,20 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
}
}
// test if default values works
public function testDefaultValues()
{
// add some animals to the farm to make sure the ArrayAccess
// interface works
$dog = new Swagger\Client\Model\Dog();
$animal = new Swagger\Client\Model\Animal();
// assert we can look up the animals in the farm by array
// indices (let's try a random order)
$this->assertSame('red', $dog->getColor());
$this->assertSame('red', $animal->getColor());
}
}
?>