コード例 #1
0
 public function tearDown()
 {
     if ($this->api) {
         $this->api->delete();
     }
     parent::tearDown();
 }
コード例 #2
0
ファイル: sqlTest.php プロジェクト: nlegoff/Phraseanet
 public function setUp()
 {
     parent::setUp();
     $report = $this->getMock('module_report', [], [], '', false);
     $report->expects($this->any())->method('getSbasId')->will($this->returnValue(self::$DI['collection']->get_databox()->get_sbas_id()));
     $this->sql = new module_report_sql(self::$DI['app'], $report);
 }
コード例 #3
0
ファイル: ACLTest.php プロジェクト: nlegoff/Phraseanet
 public function setup()
 {
     parent::setUp();
     if (!self::$object) {
         self::$object = self::$DI['app']['acl']->get(self::$DI['user']);
     }
 }
コード例 #4
0
ファイル: sqlFilterTest.php プロジェクト: nlegoff/Phraseanet
 public function setUp()
 {
     parent::setUp();
     $date = new Datetime();
     $dmax = $date->format("Y-m-d H:i:s");
     $date->modify('-6 month');
     $dmin = $date->format("Y-m-d H:i:s");
     $databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes();
     $ret = [];
     foreach ($databoxes as $databox) {
         $colls = $databox->get_collections();
         $rett = [];
         foreach ($colls as $coll) {
             $rett[$coll->get_coll_id()] = $coll->get_coll_id();
         }
         $ret[$databox->get_sbas_id()] = implode(',', $rett);
     }
     foreach ($ret as $sbasid => $collections) {
         $report = new module_report_connexion(self::$DI['app'], $dmin, $dmax, $sbasid, $collections);
         if (!$this->report instanceof module_report) {
             $this->report = $report;
         } elseif ($report->getTotal() > $this->report->getTotal()) {
             $this->report = $report;
         }
     }
     $this->report->setFilter([['f' => 'user', 'o' => '=', 'v' => 'admin'], ['f' => 'ddate', 'o' => 'LIKE', 'v' => '*'], ['f' => '1', 'o' => 'OR', 'v' => '1']]);
     $this->report->setUser_id(self::$DI['user']->getId());
     $this->report->setOrder('user', 'ASC');
     $this->filter = new module_report_sqlfilter(self::$DI['app'], $this->report);
 }
コード例 #5
0
ファイル: collectionTest.php プロジェクト: nlegoff/Phraseanet
 public static function tearDownAfterClass()
 {
     if (self::$object instanceof \collection) {
         self::$object->delete();
     }
     self::$object = self::$objectDisable = null;
     parent::tearDownAfterClass();
 }
コード例 #6
0
 public function setUp()
 {
     parent::setUp();
     self::$DI['app']->register(new \API_V1_Timer());
     self::$DI['app']['conf']->set(['main', 'api-timers'], true);
     $this->api = $this->getMock("API_V1_adapter", ["get_version"], [], "", false);
     $this->api->expects($this->any())->method("get_version")->will($this->returnValue("my_super_version1.0"));
 }
コード例 #7
0
ファイル: ApiTest.php プロジェクト: nlegoff/Phraseanet
 public function tearDown()
 {
     if ($this->object) {
         $this->object->delete();
     }
     try {
         new Bridge_Api(self::$DI['app'], $this->id);
         $this->fail();
     } catch (Bridge_Exception_ApiNotFound $e) {
     }
     parent::tearDown();
 }
コード例 #8
0
ファイル: AccountTest.php プロジェクト: nlegoff/Phraseanet
 public static function tearDownAfterClass()
 {
     if (self::$object) {
         self::$object->delete();
         self::$object = null;
     }
     if (self::$api) {
         self::$api->delete();
         self::$api = null;
     }
     self::$object = self::$api = self::$dist_id = self::$named = self::$id = null;
     parent::tearDownAfterClass();
 }
コード例 #9
0
ファイル: ElementTest.php プロジェクト: nlegoff/Phraseanet
 public function tearDown()
 {
     if ($this->object) {
         $this->object->delete();
     }
     try {
         new Bridge_Element(self::$DI['app'], $this->account, $this->id);
         $this->fail();
     } catch (Bridge_Exception_ElementNotFound $e) {
     }
     if ($this->api) {
         $this->api->delete();
     }
     parent::tearDown();
 }
コード例 #10
0
ファイル: pushTest.php プロジェクト: nlegoff/Phraseanet
 public function setUp()
 {
     parent::setUp();
     $date = new Datetime();
     $this->dmax = $date->format("Y-m-d H:i:s");
     $date->modify('-6 month');
     $this->dmin = $date->format("Y-m-d H:i:s");
     $databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes();
     $this->ret = [];
     foreach ($databoxes as $databox) {
         $colls = $databox->get_collections();
         $rett = [];
         foreach ($colls as $coll) {
             $rett[$coll->get_coll_id()] = $coll->get_coll_id();
         }
         $this->ret[$databox->get_sbas_id()] = implode(',', $rett);
     }
 }
コード例 #11
0
ファイル: dashboardTest.php プロジェクト: nlegoff/Phraseanet
 public function setUp()
 {
     parent::setUp();
     $this->dashboard = new module_report_dashboard(self::$DI['app'], self::$DI['user']);
     $this->dashboard->setDate('-2 month', 'now');
     $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $this->dashboard->legendDay);
     $this->assertNotNull($this->dashboard->dmin);
     $this->assertNotNull($this->dashboard->dmax);
     $this->assertGreaterThanOrEqual(1, count($this->dashboard->authorizedCollection));
     $this->assertEquals($this->dashboard->authorizedCollection, $this->dashboard->authorizedCollection());
     foreach ($this->dashboard->authorizedCollection as $coll) {
         $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $coll);
         $this->assertArrayHasKey('sbas_id', $coll);
         $this->assertArrayHasKey('coll', $coll);
         $this->assertArrayHasKey('name', $coll);
         $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $coll['sbas_id']);
         $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $coll['name']);
         $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $coll['coll']);
     }
 }
コード例 #12
0
ファイル: reportTest.php プロジェクト: nlegoff/Phraseanet
 public function setUp()
 {
     parent::setUp();
     $this->xml = '<?xml version="1.0" encoding="UTF-8"?>
     <record record_id="299">
       <description>
         <report ok="1">hello</report>
       </description>
      </record>';
     $date = new Datetime();
     $this->dmax = $date->format("Y-m-d H:i:s");
     $date->modify('-6 month');
     $this->dmin = $date->format("Y-m-d H:i:s");
     $databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes();
     $this->ret = [];
     foreach ($databoxes as $databox) {
         $colls = $databox->get_collections();
         $rett = [];
         foreach ($colls as $coll) {
             $rett[$coll->get_coll_id()] = $coll->get_coll_id();
         }
         $this->ret[$databox->get_sbas_id()] = implode(',', $rett);
     }
 }
コード例 #13
0
ファイル: adapterTest.php プロジェクト: luisbrito/Phraseanet
 public static function tearDownAfterClass()
 {
     self::$thumbtitled = null;
     parent::tearDownAfterClass();
 }
コード例 #14
0
 public static function tearDownAfterClass()
 {
     self::$searchEngine = self::$searchEngineClass = self::$initialized = null;
     parent::tearDownAfterClass();
 }
コード例 #15
0
 public function setUp()
 {
     parent::setUp();
     $this->StubbedACL = $this->getMockBuilder('\\ACL')->disableOriginalConstructor()->getMock();
 }
コード例 #16
0
 public function setUp()
 {
     parent::setUp();
     self::$DI['app']->register(new \API_V1_Timer());
     $this->object = new API_V1_adapter(self::$DI['app']);
 }