Esempio n. 1
0
 public function testName()
 {
     $resource = new Resource();
     $this->assertNull($resource->getName());
     $this->assertInstanceOf('iMoneza\\Data\\Resource', $resource->setName('my name'));
     $this->assertEquals('my name', $resource->getName());
 }
 public function testPopulateWithClass()
 {
     $values = ['Name' => 'the name', 'Property' => ['Name' => 'property name']];
     $resource = new Resource();
     $resource->populate($values);
     $this->assertInstanceOf('iMoneza\\Data\\Property', $resource->getProperty());
     $this->assertEquals('property name', $resource->getProperty()->getName());
     $this->assertEquals('the name', $resource->getName());
 }