Example #1
0
 public function testSaving()
 {
     $object = \Product::loadOne(1);
     $this->assertEquals('Test', $object->title, 'Object has new title after loading');
     $object = new \Product();
     $this->assertTrue($object->isNew(), 'Newly created object returns isNew true');
     $object->mergeWithData(array('title' => 'ipad', 'id_brand' => 1));
     $object->save();
     $this->assertEquals(array('id' => 2, 'title' => 'ipad', 'id_brand' => 1), $object->getArray(), 'Newly created object merged and saved');
 }