/**
  * Set up tests.
  *
  * @since 2.0
  */
 protected function setUp()
 {
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $standardGroup = new Rights();
     $standardGroup->rebuildTable();
     $standardGroup->set('name', 'Standard');
     $standardGroup->save();
     $person = new Person();
     $person->set('displayName', 'unittestuser');
     $person->set('email', '*****@*****.**');
     $person->set('password', 'password');
     $person->rebuildTable();
     $person->save();
     $article = new Article();
     $article->set('title', 'unit test');
     $article->set('description', 'unit test');
     $article->set('content', 'unit test');
     $article->set('author', 'unit test');
     $article->rebuildTable();
     $article->save();
     $comment = new ArticleComment();
     $comment->set('content', 'unit test');
     $comment->getPropObject('articleOID')->setValue($article->getOID());
     $comment->rebuildTable();
     $comment->save();
 }
 /**
  * Set up tests.
  *
  * @since 2.0
  */
 protected function setUp()
 {
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $action = new ActionLog();
     $action->rebuildTable();
     $tag = new Tag();
     $tag->rebuildTable();
     $denum = new DEnum();
     $denum->rebuildTable();
     $item = new DEnumItem();
     $item->rebuildTable();
     // create a default article DEnum category
     $denum = new DEnum('Alpha\\Model\\Article::section');
     $item->set('value', 'Main');
     $item->set('DEnumID', $denum->getID());
     $item->save();
     $article = new Article();
     $article->rebuildTable();
     $articleVote = new ArticleVote();
     $articleVote->rebuildTable();
     $articleComment = new ArticleComment();
     $articleComment->rebuildTable();
     $person = new Person();
     $person->rebuildTable();
     $rights = new Rights();
     $rights->rebuildTable();
     $rights->set('name', 'Standard');
     $rights->save();
     $rights = new Rights();
     $rights->set('name', 'Admin');
     $rights->save();
 }
Example #3
0
 /**
  * Set up tests.
  *
  * @since 1.0
  */
 protected function setUp()
 {
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $tag = new Tag();
     $tag->rebuildTable();
     $denum = new DEnum();
     $denum->rebuildTable();
     $item = new DEnumItem();
     $item->rebuildTable();
     $article = new Article();
     $article->rebuildTable();
     $this->controller = new ImageController();
     $this->person = $this->createPersonObject('unitTestUser');
     $this->person->rebuildTable();
     $this->article = $this->createArticleObject('unitTestArticle');
     $this->article->rebuildTable();
     $this->group = new Rights();
     $this->group->rebuildTable();
     $this->group->set('name', 'Admin');
     $this->group->save();
     $this->group = new Rights();
     $this->group->set('name', 'Standard');
     $this->group->save();
     $lookup = $this->group->getMembers()->getLookup();
     $lookup->setValue('00000000001', $this->group->getOID());
     $lookup->save();
 }
 /**
  * Set up tests.
  *
  * @since 2.0
  */
 protected function setUp()
 {
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $tag = new Tag();
     $tag->rebuildTable();
     $denum = new DEnum();
     $denum->rebuildTable();
     $item = new DEnumItem();
     $item->rebuildTable();
     $article = new Article();
     $article->rebuildTable();
     $articleVote = new ArticleVote();
     $articleVote->rebuildTable();
     $articleComment = new ArticleComment();
     $articleComment->rebuildTable();
     $person = new Person();
     $person->rebuildTable();
     $rights = new Rights();
     $rights->rebuildTable();
     $rights->set('name', 'Standard');
     $rights->save();
     $rights = new Rights();
     $rights->set('name', 'Admin');
     $rights->save();
 }
 /**
  * {@inheritdoc}
  *
  * @since 2.0
  */
 protected function setUp()
 {
     parent::setUp();
     $article = new Article();
     $article->rebuildTable();
     $articleComment = new ArticleComment();
     $articleComment->rebuildTable();
 }
Example #6
0
 /**
  * Set up tests.
  *
  * @since 2.0
  */
 protected function setUp()
 {
     parent::setUp();
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $tag = new Tag();
     $tag->rebuildTable();
     $article = new Article();
     $article->rebuildTable();
 }
Example #7
0
 /**
  * Set up tests.
  *
  * @since 1.0
  */
 protected function setUp()
 {
     $tag = new Tag();
     $tag->rebuildTable();
     $denum = new DEnum();
     $denum->rebuildTable();
     $item = new DEnumItem();
     $item->rebuildTable();
     $article = new Article();
     $article->rebuildTable();
     $denum = new DEnum('Alpha\\Model\\Article::section');
     $item->set('DEnumID', $denum->getOID());
     $item->set('value', 'Test');
     $item->save();
     $this->DEnumID = $denum->getOID();
     $this->article = $this->createArticle('unitTestArticle');
 }
Example #8
0
 /**
  * Set up tests.
  *
  * @since 2.0
  */
 protected function setUp()
 {
     $config = ConfigProvider::getInstance();
     $config->set('session.provider.name', 'Alpha\\Util\\Http\\Session\\SessionProviderArray');
     $tag = new Tag();
     $tag->rebuildTable();
     $denum = new DEnum();
     $denum->rebuildTable();
     $item = new DEnumItem();
     $item->rebuildTable();
     $article = new Article();
     $article->rebuildTable();
     $denum = new DEnum('Alpha\\Model\\Article::section');
     $item->set('DEnumID', $denum->getOID());
     $item->set('value', 'Test');
     $item->save();
     $this->DEnumID = $denum->getOID();
     $this->article = $this->createArticle('unitTestArticle');
 }
Example #9
0
 /**
  * Called before the test functions will be executed
  * this function is defined in PHPUnit_TestCase and overwritten
  * here.
  *
  * @since 1.0
  */
 protected function setUp()
 {
     parent::setUp();
     $this->rel1 = new Relation();
     $rights = new Rights();
     $rights->rebuildTable();
     $article = new Article();
     $article->rebuildTable();
     $comment = new ArticleComment();
     $comment->rebuildTable();
     $standardGroup = new Rights();
     $standardGroup->set('name', 'Standard');
     $standardGroup->save();
     $this->person = new Person();
     $this->person->set('displayName', 'unittestuser');
     $this->person->set('email', '*****@*****.**');
     $this->person->set('password', 'password');
     $this->person->rebuildTable();
     $this->person->save();
 }
Example #10
0
 /**
  * Called before the test functions will be executed
  * this function is defined in PHPUnit_TestCase and overwritten
  * here.
  *
  * @since 1.0
  */
 protected function setUp()
 {
     parent::setUp();
     $config = ConfigProvider::getInstance();
     foreach ($this->getActiveRecordProviders() as $provider) {
         $config->set('db.provider.name', $provider[0]);
         $rights = new Rights();
         $rights->rebuildTable();
         $standardGroup = new Rights();
         $standardGroup->set('name', 'Standard');
         $standardGroup->save();
         $request = new BadRequest();
         $request->rebuildTable();
         $this->person = $this->createPersonObject('unitTestUser');
         $this->person->rebuildTable();
         $lookup = new RelationLookup('Alpha\\Model\\Person', 'Alpha\\Model\\Rights');
         // just making sure no previous test user is in the DB
         $this->person->deleteAllByAttribute('URL', 'http://unitTestUser/');
         $this->person->deleteAllByAttribute('displayName', 'unitTestUser');
         $article = new Article();
         $article->rebuildTable();
         $comment = new ArticleComment();
         $comment->rebuildTable();
         $tag = new Tag();
         $tag->rebuildTable();
     }
 }
Example #11
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');
 }