Beispiel #1
0
 /**
  * (non-PHPdoc).
  *
  * @see alpha/lib/PEAR/PHPUnit-3.2.9/PHPUnit/Framework/PHPUnit_Framework_TestCase::tearDown()
  * @since 1.0
  */
 protected function tearDown()
 {
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $this->controller->abort();
     $this->article->dropTable();
     unset($this->article);
     unset($this->controller);
     $this->person->dropTable();
     unset($this->person);
     $this->group->dropTable();
     $this->group->dropTable('Person2Rights');
     unset($this->group);
     $article = new Article();
     $article->dropTable();
     $tag = new Tag();
     $tag->dropTable();
     $denum = new DEnum();
     $denum->dropTable();
     $item = new DEnumItem();
     $item->dropTable();
 }
Beispiel #2
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');
 }