示例#1
0
 /**
  * Testing that aborting a unit of work clears the list of new objects.
  *
  * @since 1.0
  */
 public function testAbort()
 {
     $person = $this->createPersonObject('newuser');
     $person->set('email', '*****@*****.**');
     $this->controller->markNew($person);
     // calling the constructor of the other controller will check the session
     $controller2 = new ImageController();
     $new = $controller2->getNewObjects();
     $this->assertEquals('*****@*****.**', $new[0]->get('email'), 'Testing that objects are being added to the newObjects array correctly and that this array is in the session being shared by controllers');
     // now abort the unit of work from the second controller, and confirm that the new object array is empty
     $controller2->abort();
     $new = $controller2->getNewObjects();
     $this->assertEquals(0, count($new), 'Testing that aborting a unit of work clears the list of new objects');
 }