예제 #1
0
 public function tearDown()
 {
     if ($this->api) {
         $this->api->delete();
     }
     parent::tearDown();
 }
예제 #2
0
 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
 public function setup()
 {
     parent::setUp();
     if (!self::$object) {
         self::$object = self::$DI['app']['acl']->get(self::$DI['user']);
     }
 }
예제 #4
0
 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
 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
 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
 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
 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
 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
 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
 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
 public static function tearDownAfterClass()
 {
     self::$thumbtitled = null;
     parent::tearDownAfterClass();
 }
 public static function tearDownAfterClass()
 {
     self::$searchEngine = self::$searchEngineClass = self::$initialized = null;
     parent::tearDownAfterClass();
 }
 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']);
 }