mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Update tests to use DI
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Alchemy\Phrasea\Core\Configuration;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
require_once __DIR__ . '/PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
|
require_once __DIR__ . '/PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
|
||||||
|
|
||||||
@@ -22,18 +22,19 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
/**
|
/**
|
||||||
* In case first test fails
|
* In case first test fails
|
||||||
*/
|
*/
|
||||||
$usr_id = User_Adapter::get_usr_id_from_login(self::$application, 'test_phpunit2');
|
$application = new Application('test');
|
||||||
|
$usr_id = User_Adapter::get_usr_id_from_login($application, 'test_phpunit2');
|
||||||
try {
|
try {
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = $application['phraseanet.appbox'];
|
||||||
$template = User_Adapter::getInstance($usr_id, self::$application);
|
$template = User_Adapter::getInstance($usr_id, $application);
|
||||||
$template->delete();
|
$template->delete();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
$usr_id = User_Adapter::get_usr_id_from_login(self::$application, 'test_phpunit3');
|
$usr_id = User_Adapter::get_usr_id_from_login($application, 'test_phpunit3');
|
||||||
try {
|
try {
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = $application['phraseanet.appbox'];
|
||||||
$cobaye = User_Adapter::getInstance($usr_id, self::$application);
|
$cobaye = User_Adapter::getInstance($usr_id, $application);
|
||||||
$cobaye->delete();
|
$cobaye->delete();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
@@ -58,8 +59,8 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testApply_model()
|
public function testApply_model()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$template = User_Adapter::create(self::$application, 'test_phpunit2', 'blabla2', 'test2@example.com', false);
|
$template = User_Adapter::create(self::$DI['app'], 'test_phpunit2', 'blabla2', 'test2@example.com', false);
|
||||||
$template->set_template(self::$DI['user']);
|
$template->set_template(self::$DI['user']);
|
||||||
|
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
@@ -71,7 +72,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
$template->ACL()->give_access_to_base($base_ids);
|
$template->ACL()->give_access_to_base($base_ids);
|
||||||
|
|
||||||
$cobaye = User_Adapter::create(self::$application, 'test_phpunit3', 'blabla3', 'test3@example.com', false);
|
$cobaye = User_Adapter::create(self::$DI['app'], 'test_phpunit3', 'blabla3', 'test3@example.com', false);
|
||||||
$cobaye->ACL()->apply_model($template, $base_ids);
|
$cobaye->ACL()->apply_model($template, $base_ids);
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
@@ -86,7 +87,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRevoke_access_from_bases()
|
public function testRevoke_access_from_bases()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
@@ -108,7 +109,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGive_access_to_base()
|
public function testGive_access_to_base()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
@@ -122,9 +123,9 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGive_access_to_sbas()
|
public function testGive_access_to_sbas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
foreach (self::$application['phraseanet.appbox']->get_databoxes() as $databox) {
|
foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||||
$sbas_id = $databox->get_sbas_id();
|
$sbas_id = $databox->get_sbas_id();
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
@@ -141,7 +142,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRevoke_unused_sbas_rights()
|
public function testRevoke_unused_sbas_rights()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$sbas_id = $databox->get_sbas_id();
|
$sbas_id = $databox->get_sbas_id();
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
@@ -164,7 +165,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSet_quotas_on_base()
|
public function testSet_quotas_on_base()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$base_id = $collection->get_base_id();
|
$base_id = $collection->get_base_id();
|
||||||
@@ -185,7 +186,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testDuplicate_right_from_bas()
|
public function testDuplicate_right_from_bas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$first = true;
|
$first = true;
|
||||||
$base_ref = null;
|
$base_ref = null;
|
||||||
@@ -223,7 +224,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testHas_right_on_base()
|
public function testHas_right_on_base()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$rights_false = array(
|
$rights_false = array(
|
||||||
'imgtools' => false
|
'imgtools' => false
|
||||||
@@ -270,7 +271,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testRemaining_download()
|
public function testRemaining_download()
|
||||||
{
|
{
|
||||||
|
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$base_id = $collection->get_base_id();
|
$base_id = $collection->get_base_id();
|
||||||
@@ -291,7 +292,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRemove_remaining()
|
public function testRemove_remaining()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$base_id = $collection->get_base_id();
|
$base_id = $collection->get_base_id();
|
||||||
@@ -318,7 +319,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testHas_right()
|
public function testHas_right()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
|
|
||||||
$rights = array(
|
$rights = array(
|
||||||
@@ -341,7 +342,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testHas_right_on_sbas()
|
public function testHas_right_on_sbas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$rights_false = array(
|
$rights_false = array(
|
||||||
'bas_modify_struct' => false
|
'bas_modify_struct' => false
|
||||||
@@ -380,7 +381,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_mask_and()
|
public function testGet_mask_and()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$base_id = $collection->get_base_id();
|
$base_id = $collection->get_base_id();
|
||||||
@@ -400,7 +401,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_mask_xor()
|
public function testGet_mask_xor()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$base_id = $collection->get_base_id();
|
$base_id = $collection->get_base_id();
|
||||||
@@ -421,7 +422,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testHas_access_to_base()
|
public function testHas_access_to_base()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
@@ -445,21 +446,21 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($bases as $base_id) {
|
foreach ($bases as $base_id) {
|
||||||
$stmt->execute(array(':usr_id' => self::$application['phraseanet.user']->get_id(), ':base_id' => $base_id));
|
$stmt->execute(array(':usr_id' => self::$DI['app']['phraseanet.user']->get_id(), ':base_id' => $base_id));
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$this->assertEquals(1, $row['actif']);
|
$this->assertEquals(1, $row['actif']);
|
||||||
|
|
||||||
$this->assertTrue(self::$DI['user']->ACL()->has_access_to_base($base_id));
|
$this->assertTrue(self::$DI['user']->ACL()->has_access_to_base($base_id));
|
||||||
self::$DI['user']->ACL()->update_rights_to_base($base_id, array('actif' => false));
|
self::$DI['user']->ACL()->update_rights_to_base($base_id, array('actif' => false));
|
||||||
|
|
||||||
$stmt->execute(array(':usr_id' => self::$application['phraseanet.user']->get_id(), ':base_id' => $base_id));
|
$stmt->execute(array(':usr_id' => self::$DI['app']['phraseanet.user']->get_id(), ':base_id' => $base_id));
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$this->assertEquals(0, $row['actif']);
|
$this->assertEquals(0, $row['actif']);
|
||||||
|
|
||||||
$this->assertFalse(self::$DI['user']->ACL()->has_access_to_base($base_id));
|
$this->assertFalse(self::$DI['user']->ACL()->has_access_to_base($base_id));
|
||||||
self::$DI['user']->ACL()->update_rights_to_base($base_id, array('actif' => true));
|
self::$DI['user']->ACL()->update_rights_to_base($base_id, array('actif' => true));
|
||||||
|
|
||||||
$stmt->execute(array(':usr_id' => self::$application['phraseanet.user']->get_id(), ':base_id' => $base_id));
|
$stmt->execute(array(':usr_id' => self::$DI['app']['phraseanet.user']->get_id(), ':base_id' => $base_id));
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$this->assertEquals(1, $row['actif']);
|
$this->assertEquals(1, $row['actif']);
|
||||||
|
|
||||||
@@ -478,7 +479,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testGet_granted_base()
|
public function testGet_granted_base()
|
||||||
{
|
{
|
||||||
|
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
@@ -499,7 +500,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($bases as $base_id) {
|
foreach ($bases as $base_id) {
|
||||||
try {
|
try {
|
||||||
$collection = collection::get_from_base_id(self::$application, $base_id);
|
$collection = collection::get_from_base_id(self::$DI['app'], $base_id);
|
||||||
$this->assertTrue($collection instanceof collection);
|
$this->assertTrue($collection instanceof collection);
|
||||||
$this->assertEquals($base_id, $collection->get_base_id());
|
$this->assertEquals($base_id, $collection->get_base_id());
|
||||||
unset($collection);
|
unset($collection);
|
||||||
@@ -511,7 +512,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_granted_sbas()
|
public function testGet_granted_sbas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$sbas_ids = array();
|
$sbas_ids = array();
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
@@ -538,7 +539,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testHas_access_to_module()
|
public function testHas_access_to_module()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$base_ids = array();
|
$base_ids = array();
|
||||||
@@ -602,7 +603,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testis_limited()
|
public function testis_limited()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$found = false;
|
$found = false;
|
||||||
|
|
||||||
@@ -649,7 +650,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testget_limits()
|
public function testget_limits()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$found = false;
|
$found = false;
|
||||||
|
|
||||||
|
@@ -20,22 +20,22 @@ class Bridge_Api_AbstractTest extends PhraseanetWebTestCaseAbstract
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->auth = $this->getMock("Bridge_Api_Auth_Interface");
|
$this->auth = $this->getMock("Bridge_Api_Auth_Interface");
|
||||||
$this->bridgeApi = $this->getMock('Bridge_Api_Abstract', array("is_configured", "initialize_transport", "set_auth_params", "set_transport_authentication_params"), array(self::$application['phraseanet.registry'], $this->auth, "Mock_Bridge_Api_Abstract"));
|
$this->bridgeApi = $this->getMock('Bridge_Api_Abstract', array("is_configured", "initialize_transport", "set_auth_params", "set_transport_authentication_params"), array(self::$DI['app']['phraseanet.registry'], $this->auth, "Mock_Bridge_Api_Abstract"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
try {
|
try {
|
||||||
self::$api = Bridge_Api::get_by_api_name(self::$application, 'apitest');
|
self::$api = Bridge_Api::get_by_api_name(self::$DI['app'], 'apitest');
|
||||||
} catch (Bridge_Exception_ApiNotFound $e) {
|
} catch (Bridge_Exception_ApiNotFound $e) {
|
||||||
self::$api = Bridge_Api::create(self::$application, 'apitest');
|
self::$api = Bridge_Api::create(self::$DI['app'], 'apitest');
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
self::$account = Bridge_Account::load_account_from_distant_id(self::$application, self::$api, self::$DI['user'], 'kirikoo');
|
self::$account = Bridge_Account::load_account_from_distant_id(self::$DI['app'], self::$api, self::$DI['user'], 'kirikoo');
|
||||||
} catch (Bridge_Exception_AccountNotFound $e) {
|
} catch (Bridge_Exception_AccountNotFound $e) {
|
||||||
self::$account = Bridge_Account::create(self::$application, self::$api, self::$DI['user'], 'kirikoo', 'coucou');
|
self::$account = Bridge_Account::create(self::$DI['app'], self::$api, self::$DI['user'], 'kirikoo', 'coucou');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,16 +20,16 @@ class Bridge_AccountSettingsTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
try {
|
try {
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
$this->api = Bridge_Api::create(self::$application, 'Apitest');
|
$this->api = Bridge_Api::create(self::$DI['app'], 'Apitest');
|
||||||
$this->dist_id = 'EZ1565loPP';
|
$this->dist_id = 'EZ1565loPP';
|
||||||
$this->named = 'Fête à pinpins';
|
$this->named = 'Fête à pinpins';
|
||||||
$this->account = Bridge_Account::create(self::$application, $this->api, self::$DI['user'], $this->dist_id, $this->named);
|
$this->account = Bridge_Account::create(self::$DI['app'], $this->api, self::$DI['user'], $this->dist_id, $this->named);
|
||||||
|
|
||||||
$this->object = new Bridge_AccountSettings($appbox, $this->account);
|
$this->object = new Bridge_AccountSettings($appbox, $this->account);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Alchemy\Phrasea\Core\Configuration;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
require_once __DIR__ . '/../PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
|
require_once __DIR__ . '/../PhraseanetPHPUnitAuthenticatedAbstract.class.inc';
|
||||||
require_once __DIR__ . '/Bridge_datas.inc';
|
require_once __DIR__ . '/Bridge_datas.inc';
|
||||||
@@ -10,115 +10,119 @@ class Bridge_AccountTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
/**
|
/**
|
||||||
* @var Bridge_Account
|
* @var Bridge_Account
|
||||||
*/
|
*/
|
||||||
protected $object;
|
protected static $object;
|
||||||
protected $api;
|
protected static $api;
|
||||||
protected $dist_id;
|
protected static $dist_id;
|
||||||
protected $named;
|
protected static $named;
|
||||||
protected $id;
|
protected static $id;
|
||||||
|
|
||||||
public function setUp()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUpBeforeClass();
|
||||||
try {
|
try {
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$application = new Application('test');
|
||||||
|
$appbox = $application['phraseanet.appbox'];
|
||||||
|
|
||||||
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$this->api = Bridge_Api::create(self::$application, 'Apitest');
|
self::$api = Bridge_Api::create($application, 'Apitest');
|
||||||
$this->dist_id = 'EZ1565loPP';
|
self::$dist_id = 'EZ1565loPP';
|
||||||
$this->named = 'Fête à pinpins';
|
self::$named = 'Fête à pinpins';
|
||||||
$account = Bridge_Account::create(self::$application, $this->api, self::$DI['user'], $this->dist_id, $this->named);
|
$account = Bridge_Account::create($application, self::$api, self::$DI['user'], self::$dist_id, self::$named);
|
||||||
$this->id = $account->get_id();
|
self::$id = $account->get_id();
|
||||||
|
|
||||||
$this->object = new Bridge_Account(self::$application, $this->api, $this->id);
|
self::$object = new Bridge_Account($application, self::$api, self::$id);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->fail($e->getMessage());
|
self::$fail($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
if ($this->object) {
|
if (self::$object) {
|
||||||
$this->object->delete();
|
self::$object->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new Bridge_Account(self::$application, $this->api, $this->id);
|
$application = new Application('test');
|
||||||
$this->fail();
|
new Bridge_Account($application, self::$api, self::$id);
|
||||||
|
self::$fail();
|
||||||
} catch (Bridge_Exception_AccountNotFound $e) {
|
} catch (Bridge_Exception_AccountNotFound $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($this->api) {
|
if (self::$api) {
|
||||||
$this->api->delete();
|
self::$api->delete();
|
||||||
}
|
}
|
||||||
parent::tearDown();
|
parent::tearDownAfterClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_id()
|
public function testGet_id()
|
||||||
{
|
{
|
||||||
$this->assertTrue(is_int($this->object->get_id()));
|
$this->assertTrue(is_int(self::$object->get_id()));
|
||||||
$this->assertEquals($this->id, $this->object->get_id());
|
$this->assertEquals(self::$id, self::$object->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_api()
|
public function testGet_api()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('Bridge_Api', $this->object->get_api());
|
$start = microtime(true);
|
||||||
$this->assertEquals($this->api, $this->object->get_api());
|
$this->assertInstanceOf('Bridge_Api', self::$object->get_api());
|
||||||
$this->assertEquals($this->api->get_id(), $this->object->get_api()->get_id());
|
$this->assertEquals(self::$api, self::$object->get_api());
|
||||||
|
$this->assertEquals(self::$api->get_id(), self::$object->get_api()->get_id());
|
||||||
|
var_dump(microtime(true)-$start);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_dist_id()
|
public function testGet_dist_id()
|
||||||
{
|
{
|
||||||
$this->assertEquals($this->dist_id, $this->object->get_dist_id());
|
$this->assertEquals(self::$dist_id, self::$object->get_dist_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_user()
|
public function testGet_user()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('User_Adapter', $this->object->get_user());
|
$this->assertInstanceOf('User_Adapter', self::$object->get_user());
|
||||||
$this->assertEquals(self::$DI['user']->get_id(), $this->object->get_user()->get_id());
|
$this->assertEquals(self::$DI['user']->get_id(), self::$object->get_user()->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_name()
|
public function testGet_name()
|
||||||
{
|
{
|
||||||
$this->assertEquals($this->named, $this->object->get_name());
|
$this->assertEquals(self::$named, self::$object->get_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_created_on()
|
public function testGet_created_on()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('DateTime', $this->object->get_created_on());
|
$this->assertInstanceOf('DateTime', self::$object->get_created_on());
|
||||||
$this->assertTrue($this->object->get_created_on() <= new DateTime());
|
$this->assertTrue(self::$object->get_created_on() <= new DateTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_updated_on()
|
public function testGet_updated_on()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('DateTime', $this->object->get_updated_on());
|
$this->assertInstanceOf('DateTime', self::$object->get_updated_on());
|
||||||
$this->assertTrue($this->object->get_updated_on() <= new DateTime());
|
$this->assertTrue(self::$object->get_updated_on() <= new DateTime());
|
||||||
$this->assertTrue($this->object->get_updated_on() >= $this->object->get_created_on());
|
$this->assertTrue(self::$object->get_updated_on() >= self::$object->get_created_on());
|
||||||
|
|
||||||
$update1 = $this->object->get_updated_on();
|
$update1 = self::$object->get_updated_on();
|
||||||
sleep(2);
|
sleep(2);
|
||||||
$this->object->set_name('prout');
|
self::$object->set_name('prout');
|
||||||
|
|
||||||
$update2 = $this->object->get_updated_on();
|
$update2 = self::$object->get_updated_on();
|
||||||
$this->assertTrue($update2 > $update1);
|
$this->assertTrue($update2 > $update1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSet_name()
|
public function testSet_name()
|
||||||
{
|
{
|
||||||
$new_name = 'YODELALI &é"\'(-è_çà)';
|
$new_name = 'YODELALI &é"\'(-è_çà)';
|
||||||
$this->object->set_name($new_name);
|
self::$object->set_name($new_name);
|
||||||
$this->assertEquals($new_name, $this->object->get_name());
|
$this->assertEquals($new_name, self::$object->get_name());
|
||||||
$new_name = 'BACHI BOUZOUKS';
|
$new_name = 'BACHI BOUZOUKS';
|
||||||
$this->object->set_name($new_name);
|
self::$object->set_name($new_name);
|
||||||
$this->assertEquals($new_name, $this->object->get_name());
|
$this->assertEquals($new_name, self::$object->get_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_accounts_by_api()
|
public function testGet_accounts_by_api()
|
||||||
{
|
{
|
||||||
$accounts = Bridge_Account::get_accounts_by_api(self::$application, $this->api);
|
$accounts = Bridge_Account::get_accounts_by_api(self::$DI['app'], self::$api);
|
||||||
$this->assertTrue(is_array($accounts));
|
$this->assertTrue(is_array($accounts));
|
||||||
|
|
||||||
$this->assertGreaterThan(0, count($accounts));
|
$this->assertGreaterThan(0, count($accounts));
|
||||||
@@ -130,12 +134,12 @@ class Bridge_AccountTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_settings()
|
public function testGet_settings()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('Bridge_AccountSettings', $this->object->get_settings());
|
$this->assertInstanceOf('Bridge_AccountSettings', self::$object->get_settings());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_accounts_by_user()
|
public function testGet_accounts_by_user()
|
||||||
{
|
{
|
||||||
$accounts = Bridge_Account::get_accounts_by_user(self::$application, self::$DI['user']);
|
$accounts = Bridge_Account::get_accounts_by_user(self::$DI['app'], self::$DI['user']);
|
||||||
|
|
||||||
$this->assertTrue(is_array($accounts));
|
$this->assertTrue(is_array($accounts));
|
||||||
$this->assertTrue(count($accounts) > 0);
|
$this->assertTrue(count($accounts) > 0);
|
||||||
@@ -147,8 +151,8 @@ class Bridge_AccountTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testLoad_account()
|
public function testLoad_account()
|
||||||
{
|
{
|
||||||
$account = Bridge_Account::load_account(self::$application, $this->object->get_id());
|
$account = Bridge_Account::load_account(self::$DI['app'], self::$object->get_id());
|
||||||
$this->assertEquals($this->object->get_id(), $account->get_id());
|
$this->assertEquals(self::$object->get_id(), $account->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoad_account_from_distant_id()
|
public function testLoad_account_from_distant_id()
|
||||||
|
@@ -17,7 +17,7 @@ class Bridge_ApiTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
@@ -25,10 +25,10 @@ class Bridge_ApiTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$this->type = 'Apitest';
|
$this->type = 'Apitest';
|
||||||
$api = Bridge_Api::create(self::$application, $this->type);
|
$api = Bridge_Api::create(self::$DI['app'], $this->type);
|
||||||
|
|
||||||
$this->id = $api->get_id();
|
$this->id = $api->get_id();
|
||||||
$this->object = new Bridge_Api(self::$application, $api->get_id());
|
$this->object = new Bridge_Api(self::$DI['app'], $api->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
@@ -37,7 +37,7 @@ class Bridge_ApiTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->object->delete();
|
$this->object->delete();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
new Bridge_Api(self::$application, $this->id);
|
new Bridge_Api(self::$DI['app'], $this->id);
|
||||||
$this->fail();
|
$this->fail();
|
||||||
} catch (Bridge_Exception_ApiNotFound $e) {
|
} catch (Bridge_Exception_ApiNotFound $e) {
|
||||||
|
|
||||||
|
@@ -22,24 +22,24 @@ class Bridge_ElementTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
$sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$this->api = Bridge_Api::create(self::$application, 'Apitest');
|
$this->api = Bridge_Api::create(self::$DI['app'], 'Apitest');
|
||||||
$this->dist_id = 'EZ1565loPP';
|
$this->dist_id = 'EZ1565loPP';
|
||||||
$this->named = 'Fête à pinpins';
|
$this->named = 'Fête à pinpins';
|
||||||
$this->account = Bridge_Account::create(self::$application, $this->api, self::$DI['user'], $this->dist_id, $this->named);
|
$this->account = Bridge_Account::create(self::$DI['app'], $this->api, self::$DI['user'], $this->dist_id, $this->named);
|
||||||
|
|
||||||
$this->title = 'GOGACKO';
|
$this->title = 'GOGACKO';
|
||||||
$this->status = 'Processing';
|
$this->status = 'Processing';
|
||||||
|
|
||||||
$element = Bridge_Element::create(self::$application, $this->account, self::$DI['record_1'], $this->title, $this->status, $this->account->get_api()->get_connector()->get_default_element_type());
|
$element = Bridge_Element::create(self::$DI['app'], $this->account, self::$DI['record_1'], $this->title, $this->status, $this->account->get_api()->get_connector()->get_default_element_type());
|
||||||
$this->id = $element->get_id();
|
$this->id = $element->get_id();
|
||||||
$this->object = new Bridge_Element(self::$application, $this->account, $this->id);
|
$this->object = new Bridge_Element(self::$DI['app'], $this->account, $this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
@@ -49,7 +49,7 @@ class Bridge_ElementTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new Bridge_Element(self::$application, $this->account, $this->id);
|
new Bridge_Element(self::$DI['app'], $this->account, $this->id);
|
||||||
$this->fail();
|
$this->fail();
|
||||||
} catch (Bridge_Exception_ElementNotFound $e) {
|
} catch (Bridge_Exception_ElementNotFound $e) {
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ class Bridge_ElementTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_elements_by_account()
|
public function testGet_elements_by_account()
|
||||||
{
|
{
|
||||||
$elements = Bridge_Element::get_elements_by_account(self::$application, $this->account);
|
$elements = Bridge_Element::get_elements_by_account(self::$DI['app'], $this->account);
|
||||||
$this->assertTrue(is_array($elements));
|
$this->assertTrue(is_array($elements));
|
||||||
$this->assertGreaterThan(0, count($elements));
|
$this->assertGreaterThan(0, count($elements));
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->em = self::$application['EM'];
|
$this->em = self::$DI['app']['EM'];
|
||||||
$this->basket = $this->insertOneBasket();
|
$this->basket = $this->insertOneBasket();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,18 +111,18 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGetPusher()
|
public function testGetPusher()
|
||||||
{
|
{
|
||||||
$this->assertNull($this->basket->getPusher(self::$application)); //no pusher
|
$this->assertNull($this->basket->getPusher(self::$DI['app'])); //no pusher
|
||||||
$this->basket->setPusherId(self::$DI['user']->get_id());
|
$this->basket->setPusherId(self::$DI['user']->get_id());
|
||||||
$this->assertInstanceOf('\User_Adapter', $this->basket->getPusher(self::$application));
|
$this->assertInstanceOf('\User_Adapter', $this->basket->getPusher(self::$DI['app']));
|
||||||
$this->assertEquals($this->basket->getPusher(self::$application)->get_id(), self::$DI['user']->get_id());
|
$this->assertEquals($this->basket->getPusher(self::$DI['app'])->get_id(), self::$DI['user']->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetOwner()
|
public function testGetOwner()
|
||||||
{
|
{
|
||||||
$this->assertNotNull($this->basket->getOwner(self::$application)); //no owner
|
$this->assertNotNull($this->basket->getOwner(self::$DI['app'])); //no owner
|
||||||
$this->basket->setUsrId(self::$DI['user']->get_id());
|
$this->basket->setUsrId(self::$DI['user']->get_id());
|
||||||
$this->assertInstanceOf('\User_Adapter', $this->basket->getOwner(self::$application));
|
$this->assertInstanceOf('\User_Adapter', $this->basket->getOwner(self::$DI['app']));
|
||||||
$this->assertEquals($this->basket->getOwner(self::$application)->get_id(), self::$DI['user']->get_id());
|
$this->assertEquals($this->basket->getOwner(self::$DI['app'])->get_id(), self::$DI['user']->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetValidation()
|
public function testGetValidation()
|
||||||
|
@@ -11,7 +11,7 @@ class ValidationParticipantRepositoryTest extends PhraseanetPHPUnitAuthenticated
|
|||||||
'expires' => new \DateTime('+1 days')
|
'expires' => new \DateTime('+1 days')
|
||||||
));
|
));
|
||||||
|
|
||||||
$em = self::$application['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
$repo = $em->getRepository('\Entities\ValidationParticipant');
|
$repo = $em->getRepository('\Entities\ValidationParticipant');
|
||||||
/* @var $repo \Repositories\ValidationParticipantRepository */
|
/* @var $repo \Repositories\ValidationParticipantRepository */
|
||||||
$expireDate = new \DateTime('+2 days');
|
$expireDate = new \DateTime('+2 days');
|
||||||
|
@@ -27,13 +27,13 @@ class Feed_Entry_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
|
|
||||||
self::$feed = Feed_Adapter::create(self::$application, self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
||||||
$publisher = Feed_Publisher_Adapter::getPublisher(self::$application['phraseanet.appbox'], self::$feed, self::$DI['user']);
|
$publisher = Feed_Publisher_Adapter::getPublisher(self::$DI['app']['phraseanet.appbox'], self::$feed, self::$DI['user']);
|
||||||
self::$object = Feed_Entry_Adapter::create(self::$application, self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
self::$object = Feed_Entry_Adapter::create(self::$DI['app'], self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
@@ -102,11 +102,11 @@ class Feed_Entry_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSetFeed()
|
public function testSetFeed()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$new_feed = Feed_Adapter::create(self::$application, self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
$new_feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
||||||
|
|
||||||
$publisher = Feed_Publisher_Adapter::getPublisher(self::$application['phraseanet.appbox'], $new_feed, self::$DI['user']);
|
$publisher = Feed_Publisher_Adapter::getPublisher(self::$DI['app']['phraseanet.appbox'], $new_feed, self::$DI['user']);
|
||||||
$entry = Feed_Entry_Adapter::create(self::$application, self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
$entry = Feed_Entry_Adapter::create(self::$DI['app'], self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
||||||
|
|
||||||
$this->assertEquals(self::$feed, $entry->get_feed());
|
$this->assertEquals(self::$feed, $entry->get_feed());
|
||||||
$entry->set_feed($new_feed);
|
$entry->set_feed($new_feed);
|
||||||
@@ -158,8 +158,8 @@ class Feed_Entry_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testLoad_from_id()
|
public function testLoad_from_id()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$test_entry = Feed_Entry_Adapter::load_from_id(self::$application, self::$object->get_id());
|
$test_entry = Feed_Entry_Adapter::load_from_id(self::$DI['app'], self::$object->get_id());
|
||||||
|
|
||||||
$this->assertInstanceOf('Feed_Entry_Adapter', $test_entry);
|
$this->assertInstanceOf('Feed_Entry_Adapter', $test_entry);
|
||||||
$this->assertEquals(self::$object->get_id(), $test_entry->get_id());
|
$this->assertEquals(self::$object->get_id(), $test_entry->get_id());
|
||||||
|
@@ -38,13 +38,13 @@ class Feed_Entry_CollectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
|
|
||||||
self::$feed = Feed_Adapter::create(self::$application, self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
||||||
$publisher = Feed_Publisher_Adapter::getPublisher(self::$application['phraseanet.appbox'], self::$feed, self::$DI['user']);
|
$publisher = Feed_Publisher_Adapter::getPublisher(self::$DI['app']['phraseanet.appbox'], self::$feed, self::$DI['user']);
|
||||||
self::$entry = Feed_Entry_Adapter::create(self::$application, self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
self::$entry = Feed_Entry_Adapter::create(self::$DI['app'], self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
||||||
|
|
||||||
self::$item = Feed_Entry_Item::create($appbox, self::$entry, self::$DI['record_1']);
|
self::$item = Feed_Entry_Item::create($appbox, self::$entry, self::$DI['record_1']);
|
||||||
|
|
||||||
|
@@ -33,13 +33,13 @@ class Feed_Entry_ItemTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
|
|
||||||
self::$feed = Feed_Adapter::create(self::$application, self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$feed_title, self::$feed_subtitle);
|
||||||
$publisher = Feed_Publisher_Adapter::getPublisher(self::$application['phraseanet.appbox'], self::$feed, self::$DI['user']);
|
$publisher = Feed_Publisher_Adapter::getPublisher(self::$DI['app']['phraseanet.appbox'], self::$feed, self::$DI['user']);
|
||||||
self::$entry = Feed_Entry_Adapter::create(self::$application, self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
self::$entry = Feed_Entry_Adapter::create(self::$DI['app'], self::$feed, $publisher, self::$title, self::$subtitle, self::$author_name, self::$author_email);
|
||||||
|
|
||||||
self::$object = Feed_Entry_Item::create($appbox, self::$entry, self::$DI['record_1']);
|
self::$object = Feed_Entry_Item::create($appbox, self::$entry, self::$DI['record_1']);
|
||||||
}
|
}
|
||||||
|
@@ -17,10 +17,10 @@ class Feed_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
self::$object = Feed_Adapter::create(self::$application, self::$DI['user'], self::$title, self::$subtitle);
|
self::$object = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
@@ -73,7 +73,7 @@ class Feed_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertTrue(self::$object->is_public());
|
$this->assertTrue(self::$object->is_public());
|
||||||
|
|
||||||
$coll = null;
|
$coll = null;
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$coll = $collection;
|
$coll = $collection;
|
||||||
@@ -119,7 +119,7 @@ class Feed_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
|
|
||||||
$coll = null;
|
$coll = null;
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_collections() as $collection) {
|
foreach ($databox->get_collections() as $collection) {
|
||||||
$coll = $collection;
|
$coll = $collection;
|
||||||
@@ -191,7 +191,7 @@ class Feed_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testLoad_with_user()
|
public function testLoad_with_user()
|
||||||
{
|
{
|
||||||
$this->assertEquals(Feed_Adapter::load_with_user(self::$application, self::$DI['user'], self::$object->get_id())->get_id(), self::$object->get_id());
|
$this->assertEquals(Feed_Adapter::load_with_user(self::$DI['app'], self::$DI['user'], self::$object->get_id())->get_id(), self::$object->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_count_total_entries()
|
public function testGet_count_total_entries()
|
||||||
@@ -211,7 +211,7 @@ class Feed_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testGet_homepage_link()
|
public function testGet_homepage_link()
|
||||||
{
|
{
|
||||||
self::$object->set_public(false);
|
self::$object->set_public(false);
|
||||||
$registry = self::$application['phraseanet.registry'];
|
$registry = self::$DI['app']['phraseanet.registry'];
|
||||||
$link = self::$object->get_homepage_link($registry, Feed_Adapter::FORMAT_ATOM);
|
$link = self::$object->get_homepage_link($registry, Feed_Adapter::FORMAT_ATOM);
|
||||||
$this->assertNull($link);
|
$this->assertNull($link);
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ class Feed_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_user_link()
|
public function testGet_user_link()
|
||||||
{
|
{
|
||||||
$registry = self::$application['phraseanet.registry'];
|
$registry = self::$DI['app']['phraseanet.registry'];
|
||||||
|
|
||||||
$link = self::$object->get_user_link($registry, self::$DI['user'], Feed_Adapter::FORMAT_ATOM);
|
$link = self::$object->get_user_link($registry, self::$DI['user'], Feed_Adapter::FORMAT_ATOM);
|
||||||
$supposed = '/feeds\/userfeed\/([a-zA-Z0-9]{12})\/' . self::$object->get_id() . '\/atom\//';
|
$supposed = '/feeds\/userfeed\/([a-zA-Z0-9]{12})\/' . self::$object->get_id() . '\/atom\//';
|
||||||
|
@@ -17,14 +17,14 @@ class Feed_AggregateTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
$objects[] = Feed_Adapter::create(self::$application, self::$DI['user'], self::$title, self::$subtitle);
|
$objects[] = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
||||||
$objects[] = Feed_Adapter::create(self::$application, self::$DI['user'], self::$title, self::$subtitle);
|
$objects[] = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
||||||
|
|
||||||
self::$feeds = $objects;
|
self::$feeds = $objects;
|
||||||
self::$object = new Feed_Aggregate(self::$application, self::$feeds);
|
self::$object = new Feed_Aggregate(self::$DI['app'], self::$feeds);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
@@ -59,7 +59,7 @@ class Feed_AggregateTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_homepage_link()
|
public function testGet_homepage_link()
|
||||||
{
|
{
|
||||||
$registry = self::$application['phraseanet.registry'];
|
$registry = self::$DI['app']['phraseanet.registry'];
|
||||||
$link = self::$object->get_homepage_link($registry, Feed_Adapter::FORMAT_ATOM);
|
$link = self::$object->get_homepage_link($registry, Feed_Adapter::FORMAT_ATOM);
|
||||||
$this->assertInstanceOf('Feed_Link', $link);
|
$this->assertInstanceOf('Feed_Link', $link);
|
||||||
$this->assertEquals($registry->get('GV_ServerName') . 'feeds/aggregated/atom/', $link->get_href());
|
$this->assertEquals($registry->get('GV_ServerName') . 'feeds/aggregated/atom/', $link->get_href());
|
||||||
@@ -67,7 +67,7 @@ class Feed_AggregateTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_user_link()
|
public function testGet_user_link()
|
||||||
{
|
{
|
||||||
$registry = self::$application['phraseanet.registry'];
|
$registry = self::$DI['app']['phraseanet.registry'];
|
||||||
|
|
||||||
$link = self::$object->get_user_link($registry, self::$DI['user'], Feed_Adapter::FORMAT_ATOM);
|
$link = self::$object->get_user_link($registry, self::$DI['user'], Feed_Adapter::FORMAT_ATOM);
|
||||||
$supposed = '/feeds\/userfeed\/aggregated\/([a-zA-Z0-9]{12})\/atom\//';
|
$supposed = '/feeds\/userfeed\/aggregated\/([a-zA-Z0-9]{12})\/atom\//';
|
||||||
|
@@ -17,10 +17,10 @@ class Feed_CollectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
self::$object = Feed_Adapter::create(self::$application, self::$DI['user'], self::$title, self::$subtitle);
|
self::$object = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
||||||
self::$object->set_public(true);
|
self::$object->set_public(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ class Feed_CollectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testLoad_all()
|
public function testLoad_all()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$coll = Feed_Collection::load_all(self::$application, self::$DI['user']);
|
$coll = Feed_Collection::load_all(self::$DI['app'], self::$DI['user']);
|
||||||
|
|
||||||
foreach ($coll->get_feeds() as $feed) {
|
foreach ($coll->get_feeds() as $feed) {
|
||||||
$this->assertInstanceOf('Feed_Adapter', $feed);
|
$this->assertInstanceOf('Feed_Adapter', $feed);
|
||||||
@@ -42,8 +42,8 @@ class Feed_CollectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_feeds()
|
public function testGet_feeds()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$coll = Feed_Collection::load_public_feeds(self::$application);
|
$coll = Feed_Collection::load_public_feeds(self::$DI['app']);
|
||||||
|
|
||||||
foreach ($coll->get_feeds() as $feed) {
|
foreach ($coll->get_feeds() as $feed) {
|
||||||
$this->assertInstanceOf('Feed_Adapter', $feed);
|
$this->assertInstanceOf('Feed_Adapter', $feed);
|
||||||
@@ -52,16 +52,16 @@ class Feed_CollectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_aggregate()
|
public function testGet_aggregate()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$coll = Feed_Collection::load_public_feeds(self::$application);
|
$coll = Feed_Collection::load_public_feeds(self::$DI['app']);
|
||||||
|
|
||||||
$this->assertInstanceOf('Feed_Aggregate', $coll->get_aggregate());
|
$this->assertInstanceOf('Feed_Aggregate', $coll->get_aggregate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoad_public_feeds()
|
public function testLoad_public_feeds()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$coll = Feed_Collection::load_public_feeds(self::$application);
|
$coll = Feed_Collection::load_public_feeds(self::$DI['app']);
|
||||||
|
|
||||||
foreach ($coll->get_feeds() as $feed) {
|
foreach ($coll->get_feeds() as $feed) {
|
||||||
$this->assertTrue($feed->is_public());
|
$this->assertTrue($feed->is_public());
|
||||||
|
@@ -21,10 +21,10 @@ class Feed_Publisher_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
self::$feed = Feed_Adapter::create(self::$application, self::$DI['user'], self::$title, self::$subtitle);
|
self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
||||||
self::$object = array_pop(self::$feed->get_publishers());
|
self::$object = array_pop(self::$feed->get_publishers());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@ class Session_Authentication_GuestTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->object = new Session_Authentication_Guest(self::$application);
|
$this->object = new Session_Authentication_Guest(self::$DI['app']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSignOn()
|
public function testSignOn()
|
||||||
|
@@ -17,13 +17,13 @@ class Session_Authentication_NativeTest extends PhraseanetPHPUnitAbstract
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
$login = 'testlogin';
|
$login = 'testlogin';
|
||||||
$password = 'testpassword';
|
$password = 'testpassword';
|
||||||
$usr_id = User_Adapter::get_usr_id_from_login(self::$application, $login);
|
$usr_id = User_Adapter::get_usr_id_from_login(self::$DI['app'], $login);
|
||||||
if ($usr_id) {
|
if ($usr_id) {
|
||||||
$this->local_user = User_Adapter::getInstance($usr_id, self::$application);
|
$this->local_user = User_Adapter::getInstance($usr_id, self::$DI['app']);
|
||||||
} else {
|
} else {
|
||||||
$this->local_user = User_Adapter::create(self::$application, $login, $password, null, false);
|
$this->local_user = User_Adapter::create(self::$DI['app'], $login, $password, null, false);
|
||||||
}
|
}
|
||||||
$this->object = new Session_Authentication_Native(self::$application, $login, $password);
|
$this->object = new Session_Authentication_Native(self::$DI['app'], $login, $password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
|
@@ -22,8 +22,8 @@ class Session_LoggerTest extends PhraseanetPHPUnitAbstract
|
|||||||
$user = self::$DI['user'];
|
$user = self::$DI['user'];
|
||||||
$auth = new Session_Authentication_None($user);
|
$auth = new Session_Authentication_None($user);
|
||||||
|
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
$logger_creater = self::$application['phraseanet.logger'];
|
$logger_creater = self::$DI['app']['phraseanet.logger'];
|
||||||
|
|
||||||
foreach ($user->ACL()->get_granted_sbas() as $databox) {
|
foreach ($user->ACL()->get_granted_sbas() as $databox) {
|
||||||
$this->object = $logger_creater($databox);
|
$this->object = $logger_creater($databox);
|
||||||
@@ -40,13 +40,13 @@ class Session_LoggerTest extends PhraseanetPHPUnitAbstract
|
|||||||
$log_id = $this->object->get_id();
|
$log_id = $this->object->get_id();
|
||||||
$this->assertTrue(is_int($log_id));
|
$this->assertTrue(is_int($log_id));
|
||||||
|
|
||||||
$registry = self::$application['phraseanet.registry'];
|
$registry = self::$DI['app']['phraseanet.registry'];
|
||||||
|
|
||||||
$sql = 'SELECT id FROM log
|
$sql = 'SELECT id FROM log
|
||||||
WHERE sit_session = :ses_id AND usrid = :usr_id AND site = :site';
|
WHERE sit_session = :ses_id AND usrid = :usr_id AND site = :site';
|
||||||
$params = array(
|
$params = array(
|
||||||
':ses_id' => self::$application['session']->get('phrasea_session_id')
|
':ses_id' => self::$DI['app']['session']->get('phrasea_session_id')
|
||||||
, ':usr_id' => self::$application['phraseanet.user']->get_id()
|
, ':usr_id' => self::$DI['app']['phraseanet.user']->get_id()
|
||||||
, ':site' => $registry->get('GV_sit')
|
, ':site' => $registry->get('GV_sit')
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -56,10 +56,10 @@ class Session_LoggerTest extends PhraseanetPHPUnitAbstract
|
|||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$this->assertEquals($this->object->get_id(), $row['id']);
|
$this->assertEquals($this->object->get_id(), $row['id']);
|
||||||
$log_id = $this->object->get_id();
|
$log_id = $this->object->get_id();
|
||||||
$ses_id = self::$application['session']->get('phrasea_session_id');
|
$ses_id = self::$DI['app']['session']->get('phrasea_session_id');
|
||||||
$usr_id = self::$application['phraseanet.user']->get_id();
|
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
|
||||||
|
|
||||||
self::$application->closeAccount();
|
self::$DI['app']->closeAccount();
|
||||||
|
|
||||||
$sql = 'SELECT id FROM log
|
$sql = 'SELECT id FROM log
|
||||||
WHERE sit_session = :ses_id AND usrid = :usr_id AND site = :site';
|
WHERE sit_session = :ses_id AND usrid = :usr_id AND site = :site';
|
||||||
|
@@ -14,8 +14,8 @@ class Setup_UpgradeTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$this->object = new Setup_Upgrade(self::$application);
|
$this->object = new Setup_Upgrade(self::$DI['app']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
|
@@ -17,14 +17,14 @@ class API_OAuth2_AuthCodeTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$this->application = API_OAuth2_Application::create(self::$application, self::$DI['user'], 'test app');
|
$this->application = API_OAuth2_Application::create(self::$DI['app'], self::$DI['user'], 'test app');
|
||||||
$this->account = API_OAuth2_Account::load_with_user(self::$application, $this->application, self::$DI['user']);
|
$this->account = API_OAuth2_Account::load_with_user(self::$DI['app'], $this->application, self::$DI['user']);
|
||||||
|
|
||||||
$expires = time() + 100;
|
$expires = time() + 100;
|
||||||
$this->code = random::generatePassword(8);
|
$this->code = random::generatePassword(8);
|
||||||
|
|
||||||
$this->object = API_OAuth2_AuthCode::create(self::$application, $this->account, $this->code, $expires);
|
$this->object = API_OAuth2_AuthCode::create(self::$DI['app'], $this->account, $this->code, $expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
@@ -76,7 +76,7 @@ class API_OAuth2_AuthCodeTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testLoad_codes_by_account()
|
public function testLoad_codes_by_account()
|
||||||
{
|
{
|
||||||
$this->assertTrue(is_array(API_OAuth2_AuthCode::load_codes_by_account(self::$application, $this->account)));
|
$this->assertTrue(is_array(API_OAuth2_AuthCode::load_codes_by_account(self::$DI['app'], $this->account)));
|
||||||
$this->assertTrue(count(API_OAuth2_AuthCode::load_codes_by_account(self::$application, $this->account)) > 0);
|
$this->assertTrue(count(API_OAuth2_AuthCode::load_codes_by_account(self::$DI['app'], $this->account)) > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,15 +18,15 @@ class API_OAuth2_RefreshTokenTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$this->application = API_OAuth2_Application::create(self::$application, self::$DI['user'], 'test app');
|
$this->application = API_OAuth2_Application::create(self::$DI['app'], self::$DI['user'], 'test app');
|
||||||
$this->account = API_OAuth2_Account::load_with_user(self::$application, $this->application, self::$DI['user']);
|
$this->account = API_OAuth2_Account::load_with_user(self::$DI['app'], $this->application, self::$DI['user']);
|
||||||
|
|
||||||
$expires = time() + 100;
|
$expires = time() + 100;
|
||||||
$this->token = random::generatePassword(8);
|
$this->token = random::generatePassword(8);
|
||||||
$this->scope = 'scopidou';
|
$this->scope = 'scopidou';
|
||||||
|
|
||||||
$this->object = API_OAuth2_RefreshToken::create(self::$application, $this->account, $expires, $this->token, $this->scope);
|
$this->object = API_OAuth2_RefreshToken::create(self::$DI['app'], $this->account, $expires, $this->token, $this->scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
|
@@ -15,9 +15,9 @@ class API_OAuth2_AccountTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$this->application = API_OAuth2_Application::create(self::$application, self::$DI['user'], 'test app');
|
$this->application = API_OAuth2_Application::create(self::$DI['app'], self::$DI['user'], 'test app');
|
||||||
$this->object = API_OAuth2_Account::load_with_user(self::$application, $this->application, self::$DI['user']);
|
$this->object = API_OAuth2_Account::load_with_user(self::$DI['app'], $this->application, self::$DI['user']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
@@ -74,7 +74,7 @@ class API_OAuth2_AccountTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testLoad_with_user()
|
public function testLoad_with_user()
|
||||||
{
|
{
|
||||||
$loaded = API_OAuth2_Account::load_with_user(self::$application, $this->application, self::$DI['user']);
|
$loaded = API_OAuth2_Account::load_with_user(self::$DI['app'], $this->application, self::$DI['user']);
|
||||||
$this->assertInstanceOf('API_OAuth2_Account', $loaded);
|
$this->assertInstanceOf('API_OAuth2_Account', $loaded);
|
||||||
$this->assertEquals($this->object, $loaded);
|
$this->assertEquals($this->object, $loaded);
|
||||||
}
|
}
|
||||||
|
@@ -14,8 +14,8 @@ class API_OAuth2_ApplicationTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$this->object = API_OAuth2_Application::create(self::$application, self::$DI['user'], 'test app');
|
$this->object = API_OAuth2_Application::create(self::$DI['app'], self::$DI['user'], 'test app');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
@@ -27,14 +27,14 @@ class API_OAuth2_ApplicationTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function testLoad_from_client_id()
|
public function testLoad_from_client_id()
|
||||||
{
|
{
|
||||||
$client_id = $this->object->get_client_id();
|
$client_id = $this->object->get_client_id();
|
||||||
$loaded = API_OAuth2_Application::load_from_client_id(self::$application, $client_id);
|
$loaded = API_OAuth2_Application::load_from_client_id(self::$DI['app'], $client_id);
|
||||||
$this->assertInstanceOf('API_OAuth2_Application', $loaded);
|
$this->assertInstanceOf('API_OAuth2_Application', $loaded);
|
||||||
$this->assertEquals($this->object, $loaded);
|
$this->assertEquals($this->object, $loaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoad_dev_app_by_user()
|
public function testLoad_dev_app_by_user()
|
||||||
{
|
{
|
||||||
$apps = API_OAuth2_Application::load_dev_app_by_user(self::$application, self::$DI['user']);
|
$apps = API_OAuth2_Application::load_dev_app_by_user(self::$DI['app'], self::$DI['user']);
|
||||||
$this->assertTrue(is_array($apps));
|
$this->assertTrue(is_array($apps));
|
||||||
$this->assertTrue(count($apps) > 0);
|
$this->assertTrue(count($apps) > 0);
|
||||||
$found = false;
|
$found = false;
|
||||||
@@ -50,7 +50,7 @@ class API_OAuth2_ApplicationTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testLoad_app_by_user()
|
public function testLoad_app_by_user()
|
||||||
{
|
{
|
||||||
$apps = API_OAuth2_Application::load_app_by_user(self::$application, self::$DI['user']);
|
$apps = API_OAuth2_Application::load_app_by_user(self::$DI['app'], self::$DI['user']);
|
||||||
$this->assertTrue(is_array($apps));
|
$this->assertTrue(is_array($apps));
|
||||||
$this->assertTrue(count($apps) > 0);
|
$this->assertTrue(count($apps) > 0);
|
||||||
$found = false;
|
$found = false;
|
||||||
|
@@ -15,9 +15,9 @@ class API_OAuth2_TokenTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$this->application = API_OAuth2_Application::create(self::$application, self::$DI['user'], 'test app');
|
$this->application = API_OAuth2_Application::create(self::$DI['app'], self::$DI['user'], 'test app');
|
||||||
$account = API_OAuth2_Account::load_with_user(self::$application, $this->application, self::$DI['user']);
|
$account = API_OAuth2_Account::load_with_user(self::$DI['app'], $this->application, self::$DI['user']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new API_OAuth2_Token($appbox, $account);
|
new API_OAuth2_Token($appbox, $account);
|
||||||
@@ -109,7 +109,7 @@ class API_OAuth2_TokenTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function testLoad_by_oauth_token()
|
public function testLoad_by_oauth_token()
|
||||||
{
|
{
|
||||||
$token = $this->object->get_value();
|
$token = $this->object->get_value();
|
||||||
$loaded = API_OAuth2_Token::load_by_oauth_token(self::$application, $token);
|
$loaded = API_OAuth2_Token::load_by_oauth_token(self::$DI['app'], $token);
|
||||||
$this->assertInstanceOf('API_OAuth2_Token', $loaded);
|
$this->assertInstanceOf('API_OAuth2_Token', $loaded);
|
||||||
$this->assertEquals($this->object, $loaded);
|
$this->assertEquals($this->object, $loaded);
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->object = new API_V1_adapter(self::$application);
|
$this->object = new API_V1_adapter(self::$DI['app']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_error_code()
|
public function testGet_error_code()
|
||||||
@@ -103,7 +103,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_databox_collections()
|
public function testGet_databox_collections()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$result = $this->object->get_databox_collections($request, $databox->get_sbas_id());
|
$result = $this->object->get_databox_collections($request, $databox->get_sbas_id());
|
||||||
@@ -115,7 +115,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_record()
|
public function testGet_record()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$result = $this->object->get_record($request, self::$DI['record_1']->get_sbas_id(), "-40");
|
$result = $this->object->get_record($request, self::$DI['record_1']->get_sbas_id(), "-40");
|
||||||
@@ -130,7 +130,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_databox_status()
|
public function testGet_databox_status()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$result = $this->object->get_databox_status($request, $databox->get_sbas_id());
|
$result = $this->object->get_databox_status($request, $databox->get_sbas_id());
|
||||||
@@ -142,7 +142,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_databox_metadatas()
|
public function testGet_databox_metadatas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$result = $this->object->get_databox_metadatas($request, $databox->get_sbas_id());
|
$result = $this->object->get_databox_metadatas($request, $databox->get_sbas_id());
|
||||||
@@ -154,7 +154,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_databox_terms()
|
public function testGet_databox_terms()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$result = $this->object->get_databox_terms($request, $databox->get_sbas_id());
|
$result = $this->object->get_databox_terms($request, $databox->get_sbas_id());
|
||||||
@@ -175,7 +175,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_record_related()
|
public function testGet_record_related()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$result = $this->object->get_record_related($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
$result = $this->object->get_record_related($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
||||||
@@ -186,7 +186,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_record_metadatas()
|
public function testGet_record_metadatas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$result = $this->object->get_record_metadatas($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
$result = $this->object->get_record_metadatas($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
||||||
@@ -197,7 +197,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_record_status()
|
public function testGet_record_status()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
@@ -209,7 +209,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_record_embed()
|
public function testGet_record_embed()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$result = $this->object->get_record_embed($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
$result = $this->object->get_record_embed($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
||||||
@@ -220,7 +220,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSet_record_metadatas()
|
public function testSet_record_metadatas()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databox = self::$DI['record_1']->get_databox();
|
$databox = self::$DI['record_1']->get_databox();
|
||||||
$request = new Request(array("salut" => "salut c'est la fete"), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array("salut" => "salut c'est la fete"), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$result = $this->object->set_record_metadatas($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
$result = $this->object->set_record_metadatas($request, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
|
||||||
@@ -231,7 +231,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertEquals(400, $result->get_http_code());
|
$this->assertEquals(400, $result->get_http_code());
|
||||||
|
|
||||||
if (sizeof(self::$DI['record_1']->get_caption()->get_fields()) == 0) {
|
if (sizeof(self::$DI['record_1']->get_caption()->get_fields()) == 0) {
|
||||||
$caption_field_value = caption_Field_Value::create(self::$application, databox_field::get_instance(self::$application, $databox, 1), self::$DI['record_1'], 'my value');
|
$caption_field_value = caption_Field_Value::create(self::$DI['app'], databox_field::get_instance(self::$DI['app'], $databox, 1), self::$DI['record_1'], 'my value');
|
||||||
}
|
}
|
||||||
|
|
||||||
//valide metas
|
//valide metas
|
||||||
@@ -266,7 +266,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSet_record_status()
|
public function testSet_record_status()
|
||||||
{
|
{
|
||||||
$app = self::$application;
|
$app = self::$DI['app'];
|
||||||
$stub = $this->getMock("API_V1_adapter", array("list_record_status"), array($app));
|
$stub = $this->getMock("API_V1_adapter", array("list_record_status"), array($app));
|
||||||
$databox = self::$DI['record_1']->get_databox();
|
$databox = self::$DI['record_1']->get_databox();
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSet_record_collection()
|
public function testSet_record_collection()
|
||||||
{
|
{
|
||||||
$app = self::$application;
|
$app = self::$DI['app'];
|
||||||
$stub = $this->getMock("API_V1_adapter", array("list_record"), array($app));
|
$stub = $this->getMock("API_V1_adapter", array("list_record"), array($app));
|
||||||
$databox = self::$DI['record_1']->get_databox();
|
$databox = self::$DI['record_1']->get_databox();
|
||||||
|
|
||||||
@@ -359,11 +359,11 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$response = json_decode($result->format(), true);
|
$response = json_decode($result->format(), true);
|
||||||
$this->assertArrayHasKey('basket', $response['response']);
|
$this->assertArrayHasKey('basket', $response['response']);
|
||||||
|
|
||||||
$em = self::$application['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
$repo = $em->getRepository('\Entities\Basket');
|
$repo = $em->getRepository('\Entities\Basket');
|
||||||
|
|
||||||
/* @var $repo \Repositories\BasketRepository */
|
/* @var $repo \Repositories\BasketRepository */
|
||||||
$basket = $repo->findUserBasket(self::$application, $response['response']['basket']['basket_id'], self::$application['phraseanet.user'], true);
|
$basket = $repo->findUserBasket(self::$DI['app'], $response['response']['basket']['basket_id'], self::$DI['app']['phraseanet.user'], true);
|
||||||
|
|
||||||
$this->assertTrue($basket instanceof \Entities\Basket);
|
$this->assertTrue($basket instanceof \Entities\Basket);
|
||||||
$em->remove($basket);
|
$em->remove($basket);
|
||||||
@@ -372,11 +372,11 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testDelete_basket()
|
public function testDelete_basket()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$usr_id = self::$application['phraseanet.user']->get_id();
|
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
|
||||||
$user = User_Adapter::getInstance($usr_id, self::$application);
|
$user = User_Adapter::getInstance($usr_id, self::$DI['app']);
|
||||||
|
|
||||||
$em = self::$application['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
|
|
||||||
$Basket = new Entities\Basket();
|
$Basket = new Entities\Basket();
|
||||||
$Basket->setName('Delete test');
|
$Basket->setName('Delete test');
|
||||||
@@ -396,7 +396,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$repo = $em->getRepository('\Entities\Basket');
|
$repo = $em->getRepository('\Entities\Basket');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$repo->findUserBasket(self::$application, $ssel_id, $user, true);
|
$repo->findUserBasket(self::$DI['app'], $ssel_id, $user, true);
|
||||||
$this->fail('An exception should have been raised');
|
$this->fail('An exception should have been raised');
|
||||||
} catch (Exception_NotFound $e) {
|
} catch (Exception_NotFound $e) {
|
||||||
|
|
||||||
@@ -405,8 +405,8 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_basket()
|
public function testGet_basket()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$usr_id = self::$application['phraseanet.user']->get_id();
|
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
|
||||||
|
|
||||||
$basket = $this->insertOneBasket();
|
$basket = $this->insertOneBasket();
|
||||||
|
|
||||||
@@ -419,8 +419,8 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSet_basket_title()
|
public function testSet_basket_title()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$usr_id = self::$application['phraseanet.user']->get_id();
|
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
|
||||||
|
|
||||||
$basket = $this->insertOneBasket();
|
$basket = $this->insertOneBasket();
|
||||||
|
|
||||||
@@ -430,7 +430,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertEquals('application/json', $result->get_content_type());
|
$this->assertEquals('application/json', $result->get_content_type());
|
||||||
$this->assertTrue(is_array(json_decode($result->format(), true)));
|
$this->assertTrue(is_array(json_decode($result->format(), true)));
|
||||||
|
|
||||||
$repository = self::$application['EM']->getRepository('\Entities\Basket');
|
$repository = self::$DI['app']['EM']->getRepository('\Entities\Basket');
|
||||||
|
|
||||||
$ret_bask = $repository->find($basket->getId());
|
$ret_bask = $repository->find($basket->getId());
|
||||||
|
|
||||||
@@ -439,8 +439,8 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSet_basket_description()
|
public function testSet_basket_description()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$usr_id = self::$application['phraseanet.user']->get_id();
|
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
|
||||||
|
|
||||||
$basket = $this->insertOneBasket();
|
$basket = $this->insertOneBasket();
|
||||||
|
|
||||||
@@ -450,7 +450,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertEquals('application/json', $result->get_content_type());
|
$this->assertEquals('application/json', $result->get_content_type());
|
||||||
$this->assertTrue(is_array(json_decode($result->format(), true)));
|
$this->assertTrue(is_array(json_decode($result->format(), true)));
|
||||||
|
|
||||||
$repository = self::$application['EM']->getRepository('\Entities\Basket');
|
$repository = self::$DI['app']['EM']->getRepository('\Entities\Basket');
|
||||||
|
|
||||||
$ret_bask = $repository->find($basket->getId());
|
$ret_bask = $repository->find($basket->getId());
|
||||||
|
|
||||||
@@ -459,9 +459,9 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSearch_publications()
|
public function testSearch_publications()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$feed = Feed_Adapter::create(self::$application, self::$DI['user'], "hello", "salut");
|
$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], "hello", "salut");
|
||||||
$result = $this->object->search_publications($request, self::$DI['user']);
|
$result = $this->object->search_publications($request, self::$DI['user']);
|
||||||
$this->checkResponseField($result, "feeds", 'array');
|
$this->checkResponseField($result, "feeds", 'array');
|
||||||
$feed->delete();
|
$feed->delete();
|
||||||
@@ -477,15 +477,15 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_publication()
|
public function testGet_publication()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$date = new DateTime();
|
$date = new DateTime();
|
||||||
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
$feed = Feed_Adapter::create(self::$application, self::$DI['user'], "hello", "salut");
|
$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], "hello", "salut");
|
||||||
$feed_publisher = Feed_Publisher_Adapter::getPublisher(self::$application['phraseanet.appbox'], $feed, self::$DI['user']);
|
$feed_publisher = Feed_Publisher_Adapter::getPublisher(self::$DI['app']['phraseanet.appbox'], $feed, self::$DI['user']);
|
||||||
$feed_entry = Feed_Entry_Adapter::create(self::$application, $feed, $feed_publisher, "coucou", "hello", "me", "my@email.com");
|
$feed_entry = Feed_Entry_Adapter::create(self::$DI['app'], $feed, $feed_publisher, "coucou", "hello", "me", "my@email.com");
|
||||||
$feed_entry_item = Feed_Entry_Item::create($appbox, $feed_entry, self::$DI['record_1']);
|
$feed_entry_item = Feed_Entry_Item::create($appbox, $feed_entry, self::$DI['record_1']);
|
||||||
$coll = Feed_Collection::load_all(self::$application, self::$DI['user']);
|
$coll = Feed_Collection::load_all(self::$DI['app'], self::$DI['user']);
|
||||||
foreach ($coll->get_feeds() as $feed) {
|
foreach ($coll->get_feeds() as $feed) {
|
||||||
$result = $this->object->get_publication($request, $feed->get_id(), self::$DI['user']);
|
$result = $this->object->get_publication($request, $feed->get_id(), self::$DI['user']);
|
||||||
$this->checkResponseField($result, "feed", 'array');
|
$this->checkResponseField($result, "feed", 'array');
|
||||||
|
@@ -12,7 +12,7 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->object = new caption_record(self::$application, self::$DI['record_1'], self::$DI['record_1']->get_databox());
|
$this->object = new caption_record(self::$DI['app'], self::$DI['record_1'], self::$DI['record_1']->get_databox());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,7 +25,7 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract
|
|||||||
$n = $databox_field->is_multi() ? 3 : 1;
|
$n = $databox_field->is_multi() ? 3 : 1;
|
||||||
|
|
||||||
for ($i = 0; $i < $n; $i ++ ) {
|
for ($i = 0; $i < $n; $i ++ ) {
|
||||||
\caption_Field_Value::create(self::$application, $databox_field, self::$DI['record_1'], \random::generatePassword());
|
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], \random::generatePassword());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,9 +19,9 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$application->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
|
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
@@ -32,13 +32,13 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
if ( ! $found)
|
if ( ! $found)
|
||||||
self::fail('No databox found for collection test');
|
self::fail('No databox found for collection test');
|
||||||
|
|
||||||
self::$object = collection::create(self::$application, $databox, $appbox, 'test_collection', self::$DI['user']);
|
self::$object = collection::create(self::$DI['app'], $databox, $appbox, 'test_collection', self::$DI['user']);
|
||||||
|
|
||||||
if ( ! self::$object instanceof collection)
|
if ( ! self::$object instanceof collection)
|
||||||
self::fail('Unable to create collection');
|
self::fail('Unable to create collection');
|
||||||
|
|
||||||
self::$objectDisable = collection::create(self::$application, $databox, $appbox, 'test_collection', self::$DI['user']);
|
self::$objectDisable = collection::create(self::$DI['app'], $databox, $appbox, 'test_collection', self::$DI['user']);
|
||||||
self::$objectDisable->disable(self::$application['phraseanet.appbox']);
|
self::$objectDisable->disable(self::$DI['app']['phraseanet.appbox']);
|
||||||
if ( ! self::$objectDisable instanceof collection)
|
if ( ! self::$objectDisable instanceof collection)
|
||||||
self::fail('Unable to create disable collection');
|
self::fail('Unable to create disable collection');
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testDisable()
|
public function testDisable()
|
||||||
{
|
{
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$base_id = self::$object->get_base_id();
|
$base_id = self::$object->get_base_id();
|
||||||
$coll_id = self::$object->get_coll_id();
|
$coll_id = self::$object->get_coll_id();
|
||||||
self::$object->disable($appbox);
|
self::$object->disable($appbox);
|
||||||
@@ -71,7 +71,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEnable()
|
public function testEnable()
|
||||||
{
|
{
|
||||||
self::$objectDisable->enable(self::$application['phraseanet.appbox']);
|
self::$objectDisable->enable(self::$DI['app']['phraseanet.appbox']);
|
||||||
$this->assertTrue(is_int(self::$objectDisable->get_base_id()));
|
$this->assertTrue(is_int(self::$objectDisable->get_base_id()));
|
||||||
$this->assertTrue(is_int(self::$objectDisable->get_coll_id()));
|
$this->assertTrue(is_int(self::$objectDisable->get_coll_id()));
|
||||||
$this->assertTrue(self::$objectDisable->is_active());
|
$this->assertTrue(self::$objectDisable->is_active());
|
||||||
@@ -87,262 +87,262 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertEquals(1, $m);
|
$this->assertEquals(1, $m);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function testGet_record_amount()
|
public function testGet_record_amount()
|
||||||
// {
|
{
|
||||||
// self::$object->empty_collection();
|
self::$object->empty_collection();
|
||||||
// $file = new Alchemy\Phrasea\Border\File(self::$application['mediavorus']->guess(__DIR__ . '/testfiles/cestlafete.jpg'), self::$object);
|
$file = new Alchemy\Phrasea\Border\File(self::$DI['app']['mediavorus']->guess(__DIR__ . '/testfiles/cestlafete.jpg'), self::$object);
|
||||||
// record_adapter::createFromFile($file, self::$application);
|
record_adapter::createFromFile($file, self::$DI['app']);
|
||||||
// $this->assertTrue(self::$object->get_record_amount() === 1);
|
$this->assertTrue(self::$object->get_record_amount() === 1);
|
||||||
// self::$object->empty_collection();
|
self::$object->empty_collection();
|
||||||
// $this->assertTrue(self::$object->get_record_amount() === 0);
|
$this->assertTrue(self::$object->get_record_amount() === 0);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testIs_active()
|
public function testIs_active()
|
||||||
// {
|
{
|
||||||
// $this->assertTrue(is_bool(self::$object->is_active()));
|
$this->assertTrue(is_bool(self::$object->is_active()));
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_databox()
|
public function testGet_databox()
|
||||||
// {
|
{
|
||||||
// $this->assertInstanceOf('databox', self::$object->get_databox());
|
$this->assertInstanceOf('databox', self::$object->get_databox());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_connection()
|
public function testGet_connection()
|
||||||
// {
|
{
|
||||||
// $this->assertInstanceOf('connection_pdo', self::$object->get_connection());
|
$this->assertInstanceOf('connection_pdo', self::$object->get_connection());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testSet_public_presentation().
|
* @todo Implement testSet_public_presentation().
|
||||||
// */
|
*/
|
||||||
// public function testSet_public_presentation()
|
public function testSet_public_presentation()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testSet_name()
|
public function testSet_name()
|
||||||
// {
|
{
|
||||||
// self::$object->set_name('babababe bi bo bu');
|
self::$object->set_name('babababe bi bo bu');
|
||||||
// $this->assertEquals('babababe bi bo bu', self::$object->get_name());
|
$this->assertEquals('babababe bi bo bu', self::$object->get_name());
|
||||||
// self::$object->set_name('babaé&\'" bi bo bu');
|
self::$object->set_name('babaé&\'" bi bo bu');
|
||||||
// $this->assertEquals('babaé&\'" bi bo bu', self::$object->get_name());
|
$this->assertEquals('babaé&\'" bi bo bu', self::$object->get_name());
|
||||||
// self::$object->set_name('<i>babababe bi bo bu</i>');
|
self::$object->set_name('<i>babababe bi bo bu</i>');
|
||||||
// $this->assertEquals('babababe bi bo bu', self::$object->get_name());
|
$this->assertEquals('babababe bi bo bu', self::$object->get_name());
|
||||||
// self::$object->set_name('<strong>babababe bi bo bu');
|
self::$object->set_name('<strong>babababe bi bo bu');
|
||||||
// $this->assertEquals('babababe bi bo bu', self::$object->get_name());
|
$this->assertEquals('babababe bi bo bu', self::$object->get_name());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_record_details()
|
public function testGet_record_details()
|
||||||
// {
|
{
|
||||||
// $file = new Alchemy\Phrasea\Border\File(self::$application['mediavorus']->guess(__DIR__ . '/testfiles/cestlafete.jpg'), self::$object);
|
$file = new Alchemy\Phrasea\Border\File(self::$DI['app']['mediavorus']->guess(__DIR__ . '/testfiles/cestlafete.jpg'), self::$object);
|
||||||
// $record = record_adapter::createFromFile($file, self::$application);
|
$record = record_adapter::createFromFile($file, self::$DI['app']);
|
||||||
// $details = self::$object->get_record_details();
|
$details = self::$object->get_record_details();
|
||||||
//
|
|
||||||
// $this->assertTrue(is_array($details));
|
$this->assertTrue(is_array($details));
|
||||||
// foreach ($details as $detail) {
|
foreach ($details as $detail) {
|
||||||
// $this->assertTrue(is_array($detail));
|
$this->assertTrue(is_array($detail));
|
||||||
// $this->assertArrayHasKey('coll_id', $detail);
|
$this->assertArrayHasKey('coll_id', $detail);
|
||||||
// $this->asserttrue(is_int($detail['coll_id']));
|
$this->asserttrue(is_int($detail['coll_id']));
|
||||||
// $this->assertArrayHasKey('name', $detail);
|
$this->assertArrayHasKey('name', $detail);
|
||||||
// $this->asserttrue(is_string($detail['name']));
|
$this->asserttrue(is_string($detail['name']));
|
||||||
// $this->assertArrayHasKey('amount', $detail);
|
$this->assertArrayHasKey('amount', $detail);
|
||||||
// $this->asserttrue(is_int($detail['amount']));
|
$this->asserttrue(is_int($detail['amount']));
|
||||||
// $this->assertArrayHasKey('size', $detail);
|
$this->assertArrayHasKey('size', $detail);
|
||||||
// $this->asserttrue(is_int($detail['size']));
|
$this->asserttrue(is_int($detail['size']));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testUpdate_logo()
|
public function testUpdate_logo()
|
||||||
// {
|
{
|
||||||
// $pathfile = new \SplFileInfo(__DIR__ . '/testfiles/logocoll.gif');
|
$pathfile = new \SplFileInfo(__DIR__ . '/testfiles/logocoll.gif');
|
||||||
// self::$object->update_logo($pathfile);
|
self::$object->update_logo($pathfile);
|
||||||
// $this->assertEquals(file_get_contents($pathfile->getPathname()), self::$object->get_binary_minilogos());
|
$this->assertEquals(file_get_contents($pathfile->getPathname()), self::$object->get_binary_minilogos());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testReset_watermark()
|
public function testReset_watermark()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testDelete()
|
public function testDelete()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_from_base_id()
|
public function testGet_from_base_id()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_from_coll_id()
|
public function testGet_from_coll_id()
|
||||||
// {
|
{
|
||||||
// $temp_coll = collection::get_from_coll_id(self::$application, self::$object->get_databox(), self::$object->get_coll_id());
|
$temp_coll = collection::get_from_coll_id(self::$DI['app'], self::$object->get_databox(), self::$object->get_coll_id());
|
||||||
// $this->assertEquals(self::$object->get_coll_id(), $temp_coll->get_coll_id());
|
$this->assertEquals(self::$object->get_coll_id(), $temp_coll->get_coll_id());
|
||||||
// $this->assertEquals(self::$object->get_base_id(), $temp_coll->get_base_id());
|
$this->assertEquals(self::$object->get_base_id(), $temp_coll->get_base_id());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_base_id()
|
public function testGet_base_id()
|
||||||
// {
|
{
|
||||||
// $this->assertTrue(is_int(self::$object->get_base_id()));
|
$this->assertTrue(is_int(self::$object->get_base_id()));
|
||||||
// $this->assertTrue(self::$object->get_base_id() > 0);
|
$this->assertTrue(self::$object->get_base_id() > 0);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_sbas_id()
|
public function testGet_sbas_id()
|
||||||
// {
|
{
|
||||||
// $this->assertTrue(is_int(self::$object->get_sbas_id()));
|
$this->assertTrue(is_int(self::$object->get_sbas_id()));
|
||||||
// $this->assertEquals(self::$object->get_sbas_id(), self::$object->get_databox()->get_sbas_id());
|
$this->assertEquals(self::$object->get_sbas_id(), self::$object->get_databox()->get_sbas_id());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_coll_id()
|
public function testGet_coll_id()
|
||||||
// {
|
{
|
||||||
// $this->assertTrue(is_int(self::$object->get_coll_id()));
|
$this->assertTrue(is_int(self::$object->get_coll_id()));
|
||||||
// $this->assertTrue(self::$object->get_coll_id() > 0);
|
$this->assertTrue(self::$object->get_coll_id() > 0);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testGet_prefs().
|
* @todo Implement testGet_prefs().
|
||||||
// */
|
*/
|
||||||
// public function testGet_prefs()
|
public function testGet_prefs()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testSet_prefs().
|
* @todo Implement testSet_prefs().
|
||||||
// */
|
*/
|
||||||
// public function testSet_prefs()
|
public function testSet_prefs()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function testGet_name()
|
public function testGet_name()
|
||||||
// {
|
{
|
||||||
// $this->assertTrue(is_string(self::$object->get_name()));
|
$this->assertTrue(is_string(self::$object->get_name()));
|
||||||
// $this->assertTrue(trim(strip_tags(self::$object->get_name())) === self::$object->get_name());
|
$this->assertTrue(trim(strip_tags(self::$object->get_name())) === self::$object->get_name());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testGet_pub_wm().
|
* @todo Implement testGet_pub_wm().
|
||||||
// */
|
*/
|
||||||
// public function testGet_pub_wm()
|
public function testGet_pub_wm()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testIs_available().
|
* @todo Implement testIs_available().
|
||||||
// */
|
*/
|
||||||
// public function testIs_available()
|
public function testIs_available()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testUnmount_collection().
|
* @todo Implement testUnmount_collection().
|
||||||
// */
|
*/
|
||||||
// public function testUnmount_collection()
|
public function testUnmount_collection()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testCreate().
|
* @todo Implement testCreate().
|
||||||
// */
|
*/
|
||||||
// public function testCreate()
|
public function testCreate()
|
||||||
// {
|
{
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testSet_admin().
|
* @todo Implement testSet_admin().
|
||||||
// */
|
*/
|
||||||
// public function testSet_admin()
|
public function testSet_admin()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testMount_collection().
|
* @todo Implement testMount_collection().
|
||||||
// */
|
*/
|
||||||
// public function testMount_collection()
|
public function testMount_collection()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testGetLogo().
|
* @todo Implement testGetLogo().
|
||||||
// */
|
*/
|
||||||
// public function testGetLogo()
|
public function testGetLogo()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testGetWatermark().
|
* @todo Implement testGetWatermark().
|
||||||
// */
|
*/
|
||||||
// public function testGetWatermark()
|
public function testGetWatermark()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testGetPresentation().
|
* @todo Implement testGetPresentation().
|
||||||
// */
|
*/
|
||||||
// public function testGetPresentation()
|
public function testGetPresentation()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * @todo Implement testGetStamp().
|
* @todo Implement testGetStamp().
|
||||||
// */
|
*/
|
||||||
// public function testGetStamp()
|
public function testGetStamp()
|
||||||
// {
|
{
|
||||||
// // Remove the following lines when you implement this test.
|
// Remove the following lines when you implement this test.
|
||||||
// $this->markTestIncomplete(
|
$this->markTestIncomplete(
|
||||||
// 'This test has not been implemented yet.'
|
'This test has not been implemented yet.'
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,10 +25,10 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract
|
|||||||
$this->object_multi = $this->databox->get_meta_structure()->get_element_by_name($this->name_multi);
|
$this->object_multi = $this->databox->get_meta_structure()->get_element_by_name($this->name_multi);
|
||||||
|
|
||||||
if ( ! $this->object_mono instanceof databox_field) {
|
if ( ! $this->object_mono instanceof databox_field) {
|
||||||
$this->object_mono = databox_field::create(self::$application, $this->databox, $this->name_mono, false);
|
$this->object_mono = databox_field::create(self::$DI['app'], $this->databox, $this->name_mono, false);
|
||||||
}
|
}
|
||||||
if ( ! $this->object_multi instanceof databox_field) {
|
if ( ! $this->object_multi instanceof databox_field) {
|
||||||
$this->object_multi = databox_field::create(self::$application, $this->databox, $this->name_multi, true);
|
$this->object_multi = databox_field::create(self::$DI['app'], $this->databox, $this->name_multi, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,10 +51,10 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_instance()
|
public function testGet_instance()
|
||||||
{
|
{
|
||||||
$instance = databox_field::get_instance(self::$application, $this->databox, $this->object_mono->get_id());
|
$instance = databox_field::get_instance(self::$DI['app'], $this->databox, $this->object_mono->get_id());
|
||||||
$this->assertEquals($this->object_mono->get_id(), $instance->get_id());
|
$this->assertEquals($this->object_mono->get_id(), $instance->get_id());
|
||||||
|
|
||||||
$instance = databox_field::get_instance(self::$application, $this->databox, $this->object_multi->get_id());
|
$instance = databox_field::get_instance(self::$DI['app'], $this->databox, $this->object_multi->get_id());
|
||||||
$this->assertEquals($this->object_multi->get_id(), $instance->get_id());
|
$this->assertEquals($this->object_multi->get_id(), $instance->get_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -112,39 +112,39 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testOperation_and()
|
public function testOperation_and()
|
||||||
{
|
{
|
||||||
$this->assertEquals('0', databox_status::operation_and(self::$application, '0x001', '0x010'));
|
$this->assertEquals('0', databox_status::operation_and(self::$DI['app'], '0x001', '0x010'));
|
||||||
$this->assertEquals('1', databox_status::operation_and(self::$application, '01', '11'));
|
$this->assertEquals('1', databox_status::operation_and(self::$DI['app'], '01', '11'));
|
||||||
$this->assertEquals('0', databox_status::operation_and(self::$application, '01', '10'));
|
$this->assertEquals('0', databox_status::operation_and(self::$DI['app'], '01', '10'));
|
||||||
$this->assertEquals('10', databox_status::operation_and(self::$application, '11', '10'));
|
$this->assertEquals('10', databox_status::operation_and(self::$DI['app'], '11', '10'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testOperation_and_not()
|
public function testOperation_and_not()
|
||||||
{
|
{
|
||||||
$this->assertEquals('0', databox_status::operation_and_not(self::$application, '0x001', '0x011'));
|
$this->assertEquals('0', databox_status::operation_and_not(self::$DI['app'], '0x001', '0x011'));
|
||||||
$this->assertEquals('0', databox_status::operation_and_not(self::$application, '01', '11'));
|
$this->assertEquals('0', databox_status::operation_and_not(self::$DI['app'], '01', '11'));
|
||||||
$this->assertEquals('1', databox_status::operation_and_not(self::$application, '01', '10'));
|
$this->assertEquals('1', databox_status::operation_and_not(self::$DI['app'], '01', '10'));
|
||||||
$this->assertEquals('1', databox_status::operation_and_not(self::$application, '11', '10'));
|
$this->assertEquals('1', databox_status::operation_and_not(self::$DI['app'], '11', '10'));
|
||||||
$this->assertEquals('10', databox_status::operation_and_not(self::$application, '10', '01'));
|
$this->assertEquals('10', databox_status::operation_and_not(self::$DI['app'], '10', '01'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testOperation_or()
|
public function testOperation_or()
|
||||||
{
|
{
|
||||||
$this->assertEquals('10001', databox_status::operation_or(self::$application, '0x001', '0x011'));
|
$this->assertEquals('10001', databox_status::operation_or(self::$DI['app'], '0x001', '0x011'));
|
||||||
$this->assertEquals('11', databox_status::operation_or(self::$application, '01', '11'));
|
$this->assertEquals('11', databox_status::operation_or(self::$DI['app'], '01', '11'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDec2bin()
|
public function testDec2bin()
|
||||||
{
|
{
|
||||||
$this->assertEquals('1010', databox_status::dec2bin(self::$application, '10'));
|
$this->assertEquals('1010', databox_status::dec2bin(self::$DI['app'], '10'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testHex2bin()
|
public function testHex2bin()
|
||||||
{
|
{
|
||||||
$this->assertEquals('10100001', databox_status::hex2bin(self::$application, '0x0A1'));
|
$this->assertEquals('10100001', databox_status::hex2bin(self::$DI['app'], '0x0A1'));
|
||||||
$this->assertEquals('10100001', databox_status::hex2bin(self::$application, '0A1'));
|
$this->assertEquals('10100001', databox_status::hex2bin(self::$DI['app'], '0A1'));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
databox_status::hex2bin(self::$application, 'G1');
|
databox_status::hex2bin(self::$DI['app'], 'G1');
|
||||||
$this->fail('Should raise an exception');
|
$this->fail('Should raise an exception');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ class geonamesTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->object = new geonames(self::$application);
|
$this->object = new geonames(self::$DI['app']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testName_from_id()
|
public function testName_from_id()
|
||||||
|
@@ -13,7 +13,7 @@ class media_Permalink_AdapterTest extends PhraseanetPHPUnitAbstract
|
|||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$databox = self::$DI['record_1']->get_databox();
|
$databox = self::$DI['record_1']->get_databox();
|
||||||
static::$object = media_Permalink_Adapter::getPermalink(self::$application, $databox, self::$DI['record_1']->get_subdef('document'));
|
static::$object = media_Permalink_Adapter::getPermalink(self::$DI['app'], $databox, self::$DI['record_1']->get_subdef('document'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetPermalink()
|
public function testGetPermalink()
|
||||||
@@ -43,7 +43,7 @@ class media_Permalink_AdapterTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_url()
|
public function testGet_url()
|
||||||
{
|
{
|
||||||
$registry = self::$application['phraseanet.registry'];
|
$registry = self::$DI['app']['phraseanet.registry'];
|
||||||
$url = $registry->get('GV_ServerName') . 'permalink/v1/' . static::$object->get_label() . '/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' .
|
$url = $registry->get('GV_ServerName') . 'permalink/v1/' . static::$object->get_label() . '/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' .
|
||||||
static::$object->get_token() . '/document/';
|
static::$object->get_token() . '/document/';
|
||||||
|
|
||||||
|
@@ -34,10 +34,10 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
|||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
|
|
||||||
$file = new File(self::$application['mediavorus']->guess(__DIR__ . "/../testfiles/iphone_pic.jpg"), self::$collection);
|
$file = new File(self::$DI['app']['mediavorus']->guess(__DIR__ . "/../testfiles/iphone_pic.jpg"), self::$DI['collection']);
|
||||||
|
|
||||||
self::$recordonbleu = record_adapter::createFromFile($file, self::$application);
|
self::$recordonbleu = record_adapter::createFromFile($file, self::$DI['app']);
|
||||||
self::$recordonbleu->generate_subdefs(self::$recordonbleu->get_databox(), self::$application);
|
self::$recordonbleu->generate_subdefs(self::$recordonbleu->get_databox(), self::$DI['app']);
|
||||||
|
|
||||||
foreach (self::$recordonbleu->get_subdefs() as $subdef) {
|
foreach (self::$recordonbleu->get_subdefs() as $subdef) {
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
|||||||
$width_before = self::$objectPresent->get_width();
|
$width_before = self::$objectPresent->get_width();
|
||||||
$height_before = self::$objectPresent->get_height();
|
$height_before = self::$objectPresent->get_height();
|
||||||
|
|
||||||
self::$objectPresent->rotate(90, self::$application['media-alchemyst'], self::$application['mediavorus']);
|
self::$objectPresent->rotate(90, self::$DI['app']['media-alchemyst'], self::$DI['app']['mediavorus']);
|
||||||
|
|
||||||
$this->assertEquals($width_before, self::$objectPresent->get_height());
|
$this->assertEquals($width_before, self::$objectPresent->get_height());
|
||||||
$this->assertEquals($height_before, self::$objectPresent->get_width());
|
$this->assertEquals($height_before, self::$objectPresent->get_width());
|
||||||
@@ -279,7 +279,7 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testRotateOnSubstitution()
|
public function testRotateOnSubstitution()
|
||||||
{
|
{
|
||||||
self::$objectNotPresent->rotate(90, self::$application['media-alchemyst'], self::$application['mediavorus']);
|
self::$objectNotPresent->rotate(90, self::$DI['app']['media-alchemyst'], self::$DI['app']['mediavorus']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -287,7 +287,7 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testReadTechnicalDatas()
|
public function testReadTechnicalDatas()
|
||||||
{
|
{
|
||||||
$technical_datas = self::$objectPresent->readTechnicalDatas(self::$application['mediavorus']);
|
$technical_datas = self::$objectPresent->readTechnicalDatas(self::$DI['app']['mediavorus']);
|
||||||
$this->assertArrayHasKey(media_subdef::TC_DATA_WIDTH, $technical_datas);
|
$this->assertArrayHasKey(media_subdef::TC_DATA_WIDTH, $technical_datas);
|
||||||
$this->assertArrayHasKey(media_subdef::TC_DATA_HEIGHT, $technical_datas);
|
$this->assertArrayHasKey(media_subdef::TC_DATA_HEIGHT, $technical_datas);
|
||||||
$this->assertArrayHasKey(media_subdef::TC_DATA_CHANNELS, $technical_datas);
|
$this->assertArrayHasKey(media_subdef::TC_DATA_CHANNELS, $technical_datas);
|
||||||
@@ -295,7 +295,7 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
|||||||
$this->assertArrayHasKey(media_subdef::TC_DATA_MIMETYPE, $technical_datas);
|
$this->assertArrayHasKey(media_subdef::TC_DATA_MIMETYPE, $technical_datas);
|
||||||
$this->assertArrayHasKey(media_subdef::TC_DATA_FILESIZE, $technical_datas);
|
$this->assertArrayHasKey(media_subdef::TC_DATA_FILESIZE, $technical_datas);
|
||||||
|
|
||||||
$technical_datas = self::$objectNotPresent->readTechnicalDatas(self::$application['mediavorus']);
|
$technical_datas = self::$objectNotPresent->readTechnicalDatas(self::$DI['app']['mediavorus']);
|
||||||
$this->assertEquals(array(), $technical_datas);
|
$this->assertEquals(array(), $technical_datas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,11 +9,11 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
{
|
{
|
||||||
$expires_on = new DateTime('-5 minutes');
|
$expires_on = new DateTime('-5 minutes');
|
||||||
$usr_id = self::$DI['user']->get_id();
|
$usr_id = self::$DI['user']->get_id();
|
||||||
$token = random::getUrlToken(self::$application, \random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
$token = random::getUrlToken(self::$DI['app'], \random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
||||||
random::cleanTokens(self::$application);
|
random::cleanTokens(self::$DI['app']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
random::helloToken(self::$application, $token);
|
random::helloToken(self::$DI['app'], $token);
|
||||||
$this->fail();
|
$this->fail();
|
||||||
} catch (Exception_NotFound $e) {
|
} catch (Exception_NotFound $e) {
|
||||||
|
|
||||||
@@ -60,13 +60,13 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function testGetUrlToken()
|
public function testGetUrlToken()
|
||||||
{
|
{
|
||||||
$usr_id = self::$DI['user']->get_id();
|
$usr_id = self::$DI['user']->get_id();
|
||||||
$token = random::getUrlToken(self::$application, \random::TYPE_PASSWORD, $usr_id, null, 'some nice datas');
|
$token = random::getUrlToken(self::$DI['app'], \random::TYPE_PASSWORD, $usr_id, null, 'some nice datas');
|
||||||
$datas = random::helloToken(self::$application, $token);
|
$datas = random::helloToken(self::$DI['app'], $token);
|
||||||
$this->assertEquals('some nice datas', $datas['datas']);
|
$this->assertEquals('some nice datas', $datas['datas']);
|
||||||
random::updateToken(self::$application, $token, 'some very nice datas');
|
random::updateToken(self::$DI['app'], $token, 'some very nice datas');
|
||||||
$datas = random::helloToken(self::$application, $token);
|
$datas = random::helloToken(self::$DI['app'], $token);
|
||||||
$this->assertEquals('some very nice datas', $datas['datas']);
|
$this->assertEquals('some very nice datas', $datas['datas']);
|
||||||
random::removeToken(self::$application, $token);
|
random::removeToken(self::$DI['app'], $token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRemoveToken()
|
public function testRemoveToken()
|
||||||
@@ -82,8 +82,8 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function testHelloToken()
|
public function testHelloToken()
|
||||||
{
|
{
|
||||||
$usr_id = self::$DI['user']->get_id();
|
$usr_id = self::$DI['user']->get_id();
|
||||||
$token = random::getUrlToken(self::$application, \random::TYPE_PASSWORD, $usr_id, null, 'some nice datas');
|
$token = random::getUrlToken(self::$DI['app'], \random::TYPE_PASSWORD, $usr_id, null, 'some nice datas');
|
||||||
$datas = random::helloToken(self::$application, $token);
|
$datas = random::helloToken(self::$DI['app'], $token);
|
||||||
$this->assertEquals('some nice datas', $datas['datas']);
|
$this->assertEquals('some nice datas', $datas['datas']);
|
||||||
$this->assertNull($datas['expire_on']);
|
$this->assertNull($datas['expire_on']);
|
||||||
$created_on = new DateTime($datas['created_on']);
|
$created_on = new DateTime($datas['created_on']);
|
||||||
@@ -93,9 +93,9 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
$this->assertTrue($date >= $created_on);
|
$this->assertTrue($date >= $created_on);
|
||||||
$this->assertEquals('password', $datas['type']);
|
$this->assertEquals('password', $datas['type']);
|
||||||
|
|
||||||
random::removeToken(self::$application, $token);
|
random::removeToken(self::$DI['app'], $token);
|
||||||
try {
|
try {
|
||||||
random::helloToken(self::$application, $token);
|
random::helloToken(self::$DI['app'], $token);
|
||||||
$this->fail();
|
$this->fail();
|
||||||
} catch (Exception_NotFound $e) {
|
} catch (Exception_NotFound $e) {
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
$expires_on = new DateTime('+5 minutes');
|
$expires_on = new DateTime('+5 minutes');
|
||||||
$usr_id = self::$DI['user']->get_id();
|
$usr_id = self::$DI['user']->get_id();
|
||||||
$token = random::getUrlToken(self::$application, \random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
$token = random::getUrlToken(self::$DI['app'], \random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
||||||
$datas = random::helloToken(self::$application, $token);
|
$datas = random::helloToken(self::$DI['app'], $token);
|
||||||
$this->assertEquals('some nice datas', $datas['datas']);
|
$this->assertEquals('some nice datas', $datas['datas']);
|
||||||
$sql_expires = new DateTime($datas['expire_on']);
|
$sql_expires = new DateTime($datas['expire_on']);
|
||||||
$this->assertTrue($sql_expires == $expires_on);
|
$this->assertTrue($sql_expires == $expires_on);
|
||||||
@@ -115,9 +115,9 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
$this->assertTrue($date >= $created_on);
|
$this->assertTrue($date >= $created_on);
|
||||||
$this->assertEquals('password', $datas['type']);
|
$this->assertEquals('password', $datas['type']);
|
||||||
|
|
||||||
random::removeToken(self::$application, $token);
|
random::removeToken(self::$DI['app'], $token);
|
||||||
try {
|
try {
|
||||||
random::helloToken(self::$application, $token);
|
random::helloToken(self::$DI['app'], $token);
|
||||||
$this->fail();
|
$this->fail();
|
||||||
} catch (Exception_NotFound $e) {
|
} catch (Exception_NotFound $e) {
|
||||||
|
|
||||||
@@ -126,10 +126,10 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
$expires_on = new DateTime('-5 minutes');
|
$expires_on = new DateTime('-5 minutes');
|
||||||
$usr_id = self::$DI['user']->get_id();
|
$usr_id = self::$DI['user']->get_id();
|
||||||
$token = random::getUrlToken(self::$application, \random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
$token = random::getUrlToken(self::$DI['app'], \random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
random::helloToken(self::$application, $token);
|
random::helloToken(self::$DI['app'], $token);
|
||||||
$this->fail();
|
$this->fail();
|
||||||
} catch (Exception_NotFound $e) {
|
} catch (Exception_NotFound $e) {
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$basket->setOwner(self::$DI['user']);
|
$basket->setOwner(self::$DI['user']);
|
||||||
$basket->setDescription('hello');
|
$basket->setDescription('hello');
|
||||||
|
|
||||||
$em = self::$application['EM'];
|
$em = self::$DI['app']['EM'];
|
||||||
|
|
||||||
$basketElement = new \Entities\BasketElement();
|
$basketElement = new \Entities\BasketElement();
|
||||||
|
|
||||||
@@ -55,10 +55,10 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
$receveid = array(self::$DI['record_1']->get_serialize_key() => self::$DI['record_1']);
|
$receveid = array(self::$DI['record_1']->get_serialize_key() => self::$DI['record_1']);
|
||||||
|
|
||||||
self::$application['phraseanet.user']->ACL()->update_rights_to_base(self::$DI['record_1']->get_base_id(), array('order_master' => true));
|
self::$DI['app']['phraseanet.user']->ACL()->update_rights_to_base(self::$DI['record_1']->get_base_id(), array('order_master' => true));
|
||||||
|
|
||||||
return \set_order::create(
|
return \set_order::create(
|
||||||
self::$application, new RecordsRequest($receveid, new ArrayCollection($receveid), $basket), self::$DI['user_alt2'], 'I need this photos', new \DateTime('+10 minutes')
|
self::$DI['app'], new RecordsRequest($receveid, new ArrayCollection($receveid), $basket), self::$DI['user_alt2'], 'I need this photos', new \DateTime('+10 minutes')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,9 +127,9 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testGet_base_id()
|
public function testGet_base_id()
|
||||||
{
|
{
|
||||||
$this->assertTrue(is_int(self::$DI['record_1']->get_base_id()));
|
$this->assertTrue(is_int(self::$DI['record_1']->get_base_id()));
|
||||||
$this->assertEquals(self::$collection->get_base_id(), self::$DI['record_1']->get_base_id());
|
$this->assertEquals(self::$DI['collection']->get_base_id(), self::$DI['record_1']->get_base_id());
|
||||||
$this->assertTrue(is_int(self::$DI['record_story_1']->get_base_id()));
|
$this->assertTrue(is_int(self::$DI['record_story_1']->get_base_id()));
|
||||||
$this->assertEquals(self::$collection->get_base_id(), self::$DI['record_story_1']->get_base_id());
|
$this->assertEquals(self::$DI['collection']->get_base_id(), self::$DI['record_story_1']->get_base_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_record_id()
|
public function testGet_record_id()
|
||||||
@@ -283,7 +283,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testSet_metadatas()
|
public function testSet_metadatas()
|
||||||
{
|
{
|
||||||
|
|
||||||
$meta_structure_el = self::$collection->get_databox()->get_meta_structure()->get_elements();
|
$meta_structure_el = self::$DI['collection']->get_databox()->get_meta_structure()->get_elements();
|
||||||
|
|
||||||
$current_caption = self::$DI['record_1']->get_caption();
|
$current_caption = self::$DI['record_1']->get_caption();
|
||||||
|
|
||||||
@@ -454,7 +454,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGet_record_by_sha()
|
public function testGet_record_by_sha()
|
||||||
{
|
{
|
||||||
$tmp_records = record_adapter::get_record_by_sha(self::$application, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_sha256());
|
$tmp_records = record_adapter::get_record_by_sha(self::$DI['app'], self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_sha256());
|
||||||
$this->assertTrue(is_array($tmp_records));
|
$this->assertTrue(is_array($tmp_records));
|
||||||
|
|
||||||
foreach ($tmp_records as $tmp_record) {
|
foreach ($tmp_records as $tmp_record) {
|
||||||
@@ -462,7 +462,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertEquals(self::$DI['record_1']->get_sha256(), $tmp_record->get_sha256());
|
$this->assertEquals(self::$DI['record_1']->get_sha256(), $tmp_record->get_sha256());
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp_records = record_adapter::get_record_by_sha(self::$application, self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_sha256(), self::$DI['record_1']->get_record_id());
|
$tmp_records = record_adapter::get_record_by_sha(self::$DI['app'], self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_sha256(), self::$DI['record_1']->get_record_id());
|
||||||
$this->assertTrue(is_array($tmp_records));
|
$this->assertTrue(is_array($tmp_records));
|
||||||
$this->assertTrue(count($tmp_records) === 1);
|
$this->assertTrue(count($tmp_records) === 1);
|
||||||
|
|
||||||
@@ -499,23 +499,23 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$basket_element->setRecord(self::$DI['record_1']);
|
$basket_element->setRecord(self::$DI['record_1']);
|
||||||
$basket_element->setBasket($basket);
|
$basket_element->setBasket($basket);
|
||||||
|
|
||||||
self::$application['EM']->persist($basket_element);
|
self::$DI['app']['EM']->persist($basket_element);
|
||||||
|
|
||||||
$basket->addBasketElement($basket_element);
|
$basket->addBasketElement($basket_element);
|
||||||
$basket = self::$application['EM']->merge($basket);
|
$basket = self::$DI['app']['EM']->merge($basket);
|
||||||
|
|
||||||
self::$application['EM']->flush();
|
self::$DI['app']['EM']->flush();
|
||||||
|
|
||||||
$found = $sselcont_id = false;
|
$found = $sselcont_id = false;
|
||||||
|
|
||||||
$sbas_id = self::$DI['record_1']->get_sbas_id();
|
$sbas_id = self::$DI['record_1']->get_sbas_id();
|
||||||
$record_id = self::$DI['record_1']->get_record_id();
|
$record_id = self::$DI['record_1']->get_record_id();
|
||||||
|
|
||||||
foreach (self::$DI['record_1']->get_container_baskets(self::$application['EM'], self::$application['phraseanet.user']) as $c_basket) {
|
foreach (self::$DI['record_1']->get_container_baskets(self::$DI['app']['EM'], self::$DI['app']['phraseanet.user']) as $c_basket) {
|
||||||
if ($c_basket->getId() == $basket->getId()) {
|
if ($c_basket->getId() == $basket->getId()) {
|
||||||
$found = true;
|
$found = true;
|
||||||
foreach ($c_basket->getElements() as $b_el) {
|
foreach ($c_basket->getElements() as $b_el) {
|
||||||
if ($b_el->getRecord(self::$application)->get_record_id() == $record_id && $b_el->getRecord(self::$application)->get_sbas_id() == $sbas_id)
|
if ($b_el->getRecord(self::$DI['app'])->get_record_id() == $record_id && $b_el->getRecord(self::$DI['app'])->get_sbas_id() == $sbas_id)
|
||||||
$sselcont_id = $b_el->getId();
|
$sselcont_id = $b_el->getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@ class registryTest extends PhraseanetPHPUnitAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->object = self::$application['phraseanet.registry'];
|
$this->object = self::$DI['app']['phraseanet.registry'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet()
|
public function testGet()
|
||||||
|
@@ -23,7 +23,7 @@ class activityTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -49,7 +49,7 @@ class activityTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $colllist) {
|
foreach ($this->ret as $sbasid => $colllist) {
|
||||||
$report = new module_report_activity(
|
$report = new module_report_activity(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -134,49 +134,49 @@ class activityTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function topTenUser($report, $sbasid, $colllist)
|
public function topTenUser($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->topTenUser(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->topTenUser(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activity($report, $sbasid, $colllist)
|
public function activity($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activity(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activity(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activityDay($report, $sbasid, $colllist)
|
public function activityDay($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activityDay(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activityDay(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activityQuestion($report, $sbasid, $colllist)
|
public function activityQuestion($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activityQuestion(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activityQuestion(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activiteTopTenSiteView($report, $sbasid, $colllist)
|
public function activiteTopTenSiteView($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activiteTopTenSiteView(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activiteTopTenSiteView(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activiteAddedDocument($report, $sbasid, $colllist)
|
public function activiteAddedDocument($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activiteAddedDocument(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activiteAddedDocument(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activiteEditedDocument($report, $sbasid, $colllist)
|
public function activiteEditedDocument($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activiteEditedDocument(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activiteEditedDocument(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activiteAddedTopTenUser($report, $sbasid, $colllist)
|
public function activiteAddedTopTenUser($report, $sbasid, $colllist)
|
||||||
{
|
{
|
||||||
$result = $report->activiteAddedTopTenUser(self::$application, $this->dmin, $this->dmax, $sbasid, $colllist);
|
$result = $report->activiteAddedTopTenUser(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $colllist);
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -55,7 +55,7 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_add(
|
$this->report = new module_report_add(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -76,7 +76,7 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_add(
|
$this->report = new module_report_add(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
|
@@ -19,7 +19,7 @@ class connexionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -59,7 +59,7 @@ class connexionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$nbResult = 0;
|
$nbResult = 0;
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_connexion(
|
$this->report = new module_report_connexion(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -81,7 +81,7 @@ class connexionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_connexion(
|
$this->report = new module_report_connexion(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
|
@@ -9,7 +9,7 @@ class dashboardTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->dashboard = new module_report_dashboard(self::$application, self::$DI['user']);
|
$this->dashboard = new module_report_dashboard(self::$DI['app'], self::$DI['user']);
|
||||||
$this->dashboard->setDate('-2 month', 'now');
|
$this->dashboard->setDate('-2 month', 'now');
|
||||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $this->dashboard->legendDay);
|
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $this->dashboard->legendDay);
|
||||||
$this->assertNotNull($this->dashboard->dmin);
|
$this->assertNotNull($this->dashboard->dmin);
|
||||||
|
@@ -18,7 +18,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -67,7 +67,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_download(
|
$this->report = new module_report_download(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -86,7 +86,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_download(
|
$this->report = new module_report_download(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -106,7 +106,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_download(
|
$this->report = new module_report_download(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -125,7 +125,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_download(
|
$this->report = new module_report_download(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
|
@@ -18,7 +18,7 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -44,7 +44,7 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_edit(
|
$this->report = new module_report_edit(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -64,7 +64,7 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_edit(
|
$this->report = new module_report_edit(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
|
@@ -18,7 +18,7 @@ class filterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -47,7 +47,7 @@ class filterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_connexion(
|
$this->report = new module_report_connexion(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -59,7 +59,7 @@ class filterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testFilter()
|
public function testFilter()
|
||||||
{
|
{
|
||||||
$filter = new module_report_filter(self::$application, array(), $this->report->getTransQueryString());
|
$filter = new module_report_filter(self::$DI['app'], array(), $this->report->getTransQueryString());
|
||||||
$this->assertEquals(array(), $filter->getTabFilter());
|
$this->assertEquals(array(), $filter->getTabFilter());
|
||||||
$filter->addFilter('x', 'LIKE', 'y');
|
$filter->addFilter('x', 'LIKE', 'y');
|
||||||
$filter->addFilter('x', 'LIKE', 'z');
|
$filter->addFilter('x', 'LIKE', 'z');
|
||||||
|
@@ -18,7 +18,7 @@ class pushReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -56,7 +56,7 @@ class pushReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_push(
|
$this->report = new module_report_push(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -76,7 +76,7 @@ class pushReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_push(
|
$this->report = new module_report_push(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
|
@@ -18,7 +18,7 @@ class questionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -62,7 +62,7 @@ class questionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_question(
|
$this->report = new module_report_question(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -81,7 +81,7 @@ class questionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report_question(
|
$this->report = new module_report_question(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$this->dmin,
|
$this->dmin,
|
||||||
$this->dmax,
|
$this->dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
|
@@ -31,7 +31,7 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->dmax = $date->format("Y-m-d H:i:s");
|
$this->dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$this->dmin = $date->format("Y-m-d H:i:s");
|
$this->dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$this->ret = array();
|
$this->ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -47,7 +47,7 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testReport()
|
public function testReport()
|
||||||
{
|
{
|
||||||
foreach ($this->ret as $sbasid => $collections) {
|
foreach ($this->ret as $sbasid => $collections) {
|
||||||
$this->report = new module_report(self::$application, $this->dmin, $this->dmax, $sbasid, $collections);
|
$this->report = new module_report(self::$DI['app'], $this->dmin, $this->dmax, $sbasid, $collections);
|
||||||
$this->report->setUser_id(self::$DI['user']->get_id());
|
$this->report->setUser_id(self::$DI['user']->get_id());
|
||||||
$this->assertEquals($collections, $this->report->getListCollId());
|
$this->assertEquals($collections, $this->report->getListCollId());
|
||||||
$this->host($this->report);
|
$this->host($this->report);
|
||||||
@@ -104,7 +104,7 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$report = new module_report(self::$application, $this->dmin, $this->dmax, 1, '');
|
$report = new module_report(self::$DI['app'], $this->dmin, $this->dmax, 1, '');
|
||||||
$bool = true;
|
$bool = true;
|
||||||
$report->setPrettyString($bool);
|
$report->setPrettyString($bool);
|
||||||
$this->assertEquals($bool, $report->getPrettyString());
|
$this->assertEquals($bool, $report->getPrettyString());
|
||||||
@@ -161,7 +161,7 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$r = new \ReflectionObject($report);
|
$r = new \ReflectionObject($report);
|
||||||
$p = $r->getProperty('app');
|
$p = $r->getProperty('app');
|
||||||
$p->setAccessible(true);
|
$p->setAccessible(true);
|
||||||
$p->setValue($report, self::$application);
|
$p->setValue($report, self::$DI['app']);
|
||||||
|
|
||||||
$report->setRequest('SELECT
|
$report->setRequest('SELECT
|
||||||
user,
|
user,
|
||||||
|
@@ -13,7 +13,7 @@ class sqlActionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
|
|
||||||
$this->mock = $this->getMock('module_report', array(), array(), '', false);
|
$this->mock = $this->getMock('module_report', array(), array(), '', false);
|
||||||
|
|
||||||
$this->action = new module_report_sqlaction(self::$application, $this->mock);
|
$this->action = new module_report_sqlaction(self::$DI['app'], $this->mock);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetAction()
|
public function testGetAction()
|
||||||
|
@@ -20,7 +20,7 @@ class sqlFilterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$dmax = $date->format("Y-m-d H:i:s");
|
$dmax = $date->format("Y-m-d H:i:s");
|
||||||
$date->modify('-6 month');
|
$date->modify('-6 month');
|
||||||
$dmin = $date->format("Y-m-d H:i:s");
|
$dmin = $date->format("Y-m-d H:i:s");
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
$databoxes = $appbox->get_databoxes();
|
$databoxes = $appbox->get_databoxes();
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
@@ -33,7 +33,7 @@ class sqlFilterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
foreach ($ret as $sbasid => $collections) {
|
foreach ($ret as $sbasid => $collections) {
|
||||||
$report = new module_report_connexion(
|
$report = new module_report_connexion(
|
||||||
self::$application,
|
self::$DI['app'],
|
||||||
$dmin,
|
$dmin,
|
||||||
$dmax,
|
$dmax,
|
||||||
$sbasid,
|
$sbasid,
|
||||||
@@ -49,7 +49,7 @@ class sqlFilterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->report->setFilter(array(array('f' => 'user', 'o' => '=', 'v' => 'admin'), array('f' => 'ddate', 'o' => 'LIKE', 'v' => '*'), array('f' => '1', 'o' => 'OR', 'v' => '1')));
|
$this->report->setFilter(array(array('f' => 'user', 'o' => '=', 'v' => 'admin'), array('f' => 'ddate', 'o' => 'LIKE', 'v' => '*'), array('f' => '1', 'o' => 'OR', 'v' => '1')));
|
||||||
$this->report->setUser_id(self::$DI['user']->get_id());
|
$this->report->setUser_id(self::$DI['user']->get_id());
|
||||||
$this->report->setOrder('user', 'ASC');
|
$this->report->setOrder('user', 'ASC');
|
||||||
$this->filter = new module_report_sqlfilter(self::$application, $this->report);
|
$this->filter = new module_report_sqlfilter(self::$DI['app'], $this->report);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkFilter($filter)
|
public function checkFilter($filter)
|
||||||
|
@@ -9,7 +9,7 @@ class sqlTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$report = $this->getMock('module_report', array(), array(), '', false);
|
$report = $this->getMock('module_report', array(), array(), '', false);
|
||||||
$this->sql = new module_report_sql(self::$application, $report);
|
$this->sql = new module_report_sql(self::$DI['app'], $report);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSql()
|
public function testSql()
|
||||||
|
@@ -14,12 +14,12 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
$task = \task_period_archive::create(self::$application, 'task_period_archive');
|
$task = \task_period_archive::create(self::$DI['app'], 'task_period_archive');
|
||||||
|
|
||||||
$logger = new \Monolog\Logger('test');
|
$logger = new \Monolog\Logger('test');
|
||||||
$logger->pushHandler(new \Monolog\Handler\NullHandler());
|
$logger->pushHandler(new \Monolog\Handler\NullHandler());
|
||||||
|
|
||||||
self::$object = new archiveTester($task->getID(), self::$application, $logger);
|
self::$object = new archiveTester($task->getID(), self::$DI['app'], $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
@@ -246,7 +246,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function getXml()
|
public function getXml()
|
||||||
{
|
{
|
||||||
$meta_struct = self::$collection->get_databox()->get_meta_structure();
|
$meta_struct = self::$DI['collection']->get_databox()->get_meta_structure();
|
||||||
|
|
||||||
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<record record_id="2">
|
<record record_id="2">
|
||||||
@@ -309,7 +309,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
file_put_contents($tmp, $xml);
|
file_put_contents($tmp, $xml);
|
||||||
|
|
||||||
$story = self::$object->createStory(self::$collection, $tmpFile, $tmp);
|
$story = self::$object->createStory(self::$DI['collection'], $tmpFile, $tmp);
|
||||||
|
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
file_put_contents($tmp, $xml);
|
file_put_contents($tmp, $xml);
|
||||||
|
|
||||||
$story = self::$object->createRecord(self::$collection, $tmpFile, $tmp, null, \Alchemy\Phrasea\Border\Manager::FORCE_RECORD);
|
$story = self::$object->createRecord(self::$DI['collection'], $tmpFile, $tmp, null, \Alchemy\Phrasea\Border\Manager::FORCE_RECORD);
|
||||||
|
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
|
|
||||||
@@ -417,8 +417,8 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testGetIndexByFieldName()
|
public function testGetIndexByFieldName()
|
||||||
{
|
{
|
||||||
$meta_struct = self::$collection->get_databox()->get_meta_structure();
|
$meta_struct = self::$DI['collection']->get_databox()->get_meta_structure();
|
||||||
$media = self::$application['mediavorus']->guess(__DIR__ . '/../../testfiles/test001.CR2');
|
$media = self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../testfiles/test001.CR2');
|
||||||
|
|
||||||
$bagByName = self::$object->getIndexByFieldNameTester($meta_struct, $media->getMetadatas());
|
$bagByName = self::$object->getIndexByFieldNameTester($meta_struct, $media->getMetadatas());
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testBagToArray()
|
public function testBagToArray()
|
||||||
{
|
{
|
||||||
$meta_struct = self::$collection->get_databox()->get_meta_structure();
|
$meta_struct = self::$DI['collection']->get_databox()->get_meta_structure();
|
||||||
|
|
||||||
$bag = new PHPExiftool\Driver\Metadata\MetadataBag();
|
$bag = new PHPExiftool\Driver\Metadata\MetadataBag();
|
||||||
|
|
||||||
@@ -517,7 +517,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testMergeForDatabox()
|
public function testMergeForDatabox()
|
||||||
{
|
{
|
||||||
$meta_struct = self::$collection->get_databox()->get_meta_structure();
|
$meta_struct = self::$DI['collection']->get_databox()->get_meta_structure();
|
||||||
|
|
||||||
$bag1 = new PHPExiftool\Driver\Metadata\MetadataBag();
|
$bag1 = new PHPExiftool\Driver\Metadata\MetadataBag();
|
||||||
$bag2 = new PHPExiftool\Driver\Metadata\MetadataBag();
|
$bag2 = new PHPExiftool\Driver\Metadata\MetadataBag();
|
||||||
@@ -587,7 +587,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testReadXMLForDataboxFail()
|
public function testReadXMLForDataboxFail()
|
||||||
{
|
{
|
||||||
$meta_struct = self::$collection->get_databox()->get_meta_structure();
|
$meta_struct = self::$DI['collection']->get_databox()->get_meta_structure();
|
||||||
self::$object->readXMLForDataboxTester($meta_struct, 'non existant file');
|
self::$object->readXMLForDataboxTester($meta_struct, 'non existant file');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,7 +597,7 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testReadXMLForDataboxWrongXML()
|
public function testReadXMLForDataboxWrongXML()
|
||||||
{
|
{
|
||||||
$meta_struct = self::$collection->get_databox()->get_meta_structure();
|
$meta_struct = self::$DI['collection']->get_databox()->get_meta_structure();
|
||||||
self::$object->readXMLForDataboxTester($meta_struct, __FILE__);
|
self::$object->readXMLForDataboxTester($meta_struct, __FILE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,17 +9,17 @@ class userTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testMail()
|
public function testMail()
|
||||||
{
|
{
|
||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$application, null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$DI['app'], null));
|
||||||
try {
|
try {
|
||||||
$appbox = self::$application['phraseanet.appbox'];
|
$appbox = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
self::$DI['user']->set_email(null);
|
self::$DI['user']->set_email(null);
|
||||||
|
|
||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$application, null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$DI['app'], null));
|
||||||
self::$DI['user']->set_email('');
|
self::$DI['user']->set_email('');
|
||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$application, null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$DI['app'], null));
|
||||||
self::$DI['user']->set_email('noone@example.com');
|
self::$DI['user']->set_email('noone@example.com');
|
||||||
$this->assertEquals(self::$DI['user']->get_id(), User_Adapter::get_usr_id_from_email(self::$application, 'noone@example.com'));
|
$this->assertEquals(self::$DI['user']->get_id(), User_Adapter::get_usr_id_from_email(self::$DI['app'], 'noone@example.com'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->fail($e->getMessage());
|
$this->fail($e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,6 @@ class userTest extends PhraseanetPHPUnitAbstract
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$application, null));
|
$this->assertFalse(User_Adapter::get_usr_id_from_email(self::$DI['app'], null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user