function testSettingSameTablePropertyValueDoesntMakeObjectDirty() { $object = new TestOneTableObject(); $object->setContent('whatever'); $object->save(); $this->assertFalse($object->isDirty()); $object->setContent($object->getContent()); $this->assertFalse($object->isDirty()); $object->setContent('whatever else'); $this->assertTrue($object->isDirty()); }
function testPassingArrayToConstructorCallsImport() { $source = array('id' => 1000, 'annotation' => 'Some annotation', 'content' => 'Some content'); $object = new TestOneTableObject($source); $this->assertEqual($object->getId(), 1000); $this->assertEqual($object->getAnnotation(), 'Some annotation'); $this->assertEqual($object->getContent(), 'Some content'); }