コード例 #1
0
 /**
  * @group Bug
  */
 public function testBug()
 {
     $ctx = IcingaWebTestTool::getContext();
     $file = AppKitFileUtil::getAlternateFilename(AgaviConfig::get('modules.cronks.xml.path.grid'), self::TEMPLATE, '.xml');
     $template = new CronkGridTemplateXmlParser($file->getRealPath(), $ctx);
     $template->parseTemplate();
     $worker = CronkGridTemplateWorkerFactory::createWorker($template, $ctx, self::CONNECTION);
     $this->assertGreaterThanOrEqual(0, $worker->countResults());
 }
コード例 #2
0
 public function testBug()
 {
     static $cronk_name = 'Bug3062Test_Cronk_Record';
     $ctx = IcingaWebTestTool::getContext();
     $model = $ctx->getModel('Provider.CronksData', 'Cronks');
     $testCronkData = array('cid' => $cronk_name, 'name' => $cronk_name, 'description' => $cronk_name, 'categories' => 'my', 'ae:parameter' => array('entity1' => 'd=1&d=2&d=3', 'entity2' => '<a></a>', 'entity3' => '"a", \'b\''));
     $record = $model->createCronkRecord($testCronkData);
     $this->assertInstanceOf('Cronk', $record);
     $this->assertEquals($cronk_name, $record->cronk_uid);
     $this->assertEquals($cronk_name, $record->cronk_name);
 }
コード例 #3
0
 /**
  * @group Module
  */
 public function testModuleTranslations()
 {
     $ctx = IcingaWebTestTool::getContext();
     $tm = $ctx->getTranslationManager();
     $tm->setLocale('en');
     $this->assertEquals('en', $tm->getCurrentLocaleIdentifier());
     $this->assertEquals('test1-trans', $tm->_('test1', 'testdummy.text_simple'));
     $this->assertEquals('test2-trans', $tm->_('test2', 'testdummy.text_simple'));
     $this->assertEquals(date('Y'), $tm->_d(date('Y-m-d H:i:s'), 'testdummy.date_year'));
     $this->assertEquals(date('m'), $tm->_d(date('Y-m-d H:i:s'), 'testdummy.date_month'));
 }
コード例 #4
0
 /**
  * @group CronkCategory
  * @expectedException AppKitModelException
  * @expectedExceptionMessage Category not found: phpunit_test_123123
  */
 public function testCategoryCreation()
 {
     $ctx = IcingaWebTestTool::getContext();
     IcingaWebTestTool::authenticateTestUser();
     $catid = 'phpunit_test_123123';
     $catmodel = $ctx->getModel('Provider.CronkCategoryData', 'Cronks');
     $catmodel->createCategory(array('catid' => $catid, 'title' => 'PHPUNIT test category', 'visible' => true, 'position' => '123443'));
     $test_cat = $catmodel->getCategory($catid);
     $this->assertEquals('123443', $test_cat['position']);
     $catmodel->deleteCategoryRecord($catid);
     // Throw at least
     $test_cat = $catmodel->getCategory($catid);
 }