public function testPopulateWithArrayClass() { $values = ['Name' => 'the name', 'PricingGroups' => [['Name' => 'pricing group name']]]; $property = new Property(); $property->populate($values); $this->assertTrue(is_array($property->getPricingGroups())); $this->assertEquals('pricing group name', $property->getPricingGroups()[0]->getName()); $this->assertEquals('the name', $property->getName()); }
public function testPricingGroups() { $property = new Property(); $this->assertNull($property->getPricingGroups()); $this->assertInstanceOf('iMoneza\\Data\\Property', $property->setPricingGroups(['item here'])); $this->assertEquals(['item here'], $property->getPricingGroups()); }