/**
  * {@inheritdoc}
  *
  * @since 2.0
  */
 protected function tearDown()
 {
     parent::tearDown();
     $article = new Article();
     $article->dropTable();
     $articleComment = new ArticleComment();
     $articleComment->dropTable();
 }
Example #2
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();
 }
Example #3
0
 /**
  * Tear down tests.
  *
  * @since 1.0
  */
 protected function tearDown()
 {
     $article = new Article();
     $article->dropTable();
     $tag = new Tag();
     $tag->dropTable();
     $denum = new DEnum();
     $denum->dropTable();
     $item = new DEnumItem();
     $item->dropTable();
     unset($this->article);
 }
Example #4
0
 /**
  * Called after the test functions are executed
  * this function is defined in PHPUnit_TestCase and overwritten
  * here.
  *
  * @since 1.0
  */
 protected function tearDown()
 {
     parent::tearDown();
     unset($this->rel1);
     $person = new Person();
     $person->dropTable();
     $rights = new Rights();
     $rights->dropTable();
     $rights->dropTable('Person2Rights');
     $comment = new ArticleComment();
     $comment->dropTable();
     $article = new Article();
     $article->dropTable();
 }
Example #5
0
 /**
  * Testing the RelationLookup constructor.
  *
  * @since 1.2.1
  */
 public function testConstruct()
 {
     try {
         $lookup = new RelationLookup('', '');
         $this->fail('testing the RelationLookup constructor');
     } catch (IllegalArguementException $e) {
         $this->assertEquals('Cannot create RelationLookup object without providing the left and right class names!', $e->getMessage(), 'testing the RelationLookup constructor');
     }
     $article = new Article();
     try {
         $article->dropTable();
         $lookup = new RelationLookup('Alpha\\Model\\Person', 'Alpha\\Model\\Article');
         $this->fail('testing the RelationLookup constructor');
     } catch (FailedLookupCreateException $e) {
         $this->assertEquals('Error trying to create a lookup table [Person2Article], as tables for BOs [Alpha\\Model\\Person] or [Alpha\\Model\\Article] don\'t exist!', $e->getMessage(), 'testing the RelationLookup constructor');
     }
     $article->rebuildTable();
     $lookup = new RelationLookup('Alpha\\Model\\Person', 'Alpha\\Model\\Article');
     $this->assertTrue($lookup->checkTableExists(), 'testing the RelationLookup constructor');
 }
 /**
  * Testing recreating a table via doPOST method
  */
 public function testDoPOSTRecreateTable()
 {
     $config = ConfigProvider::getInstance();
     $sessionProvider = $config->get('session.provider.name');
     $session = SessionProviderFactory::getInstance($sessionProvider);
     $front = new FrontController();
     $controller = new ListActiveRecordsController();
     $article = new Article();
     $securityParams = $controller->generateSecurityFields();
     $params = array('var1' => $securityParams[0], 'var2' => $securityParams[1], 'admin_AlphaModelArticle_button_pressed' => 'recreateTableBut', 'recreateTableClass' => 'Alpha\\Model\\Article');
     $article->dropTable();
     $this->assertFalse($article->checkTableExists());
     $request = new Request(array('method' => 'POST', 'URI' => '/listactiverecords', 'params' => $params));
     $response = $front->process($request);
     $this->assertEquals(200, $response->getStatus(), 'Testing recreating a table via doPOST method');
     $this->assertTrue($article->checkTableExists());
 }