mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Fix unit test names, property and function visibility
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\ACL;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\ACL\BasketACL;
|
use Alchemy\Phrasea\ACL\BasketACL;
|
||||||
|
|
||||||
class BasketACLTest extends \PhraseanetPHPUnitAbstract
|
class BasketACLTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testOwnerIsOwner()
|
public function testOwnerIsOwner()
|
||||||
{
|
{
|
||||||
|
@@ -4,9 +4,8 @@ namespace Alchemy\Tests\Phrasea\Application;
|
|||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class ApiJSONPApplication extends ApiAbstract
|
class ApiJSONPApplication extends ApiTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
protected function evaluateResponseBadRequest(Response $response)
|
protected function evaluateResponseBadRequest(Response $response)
|
||||||
{
|
{
|
||||||
$this->assertEquals('UTF-8', $response->getCharset(), 'Test charset response');
|
$this->assertEquals('UTF-8', $response->getCharset(), 'Test charset response');
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Application;
|
namespace Alchemy\Tests\Phrasea\Application;
|
||||||
|
|
||||||
class ApiJsonApplication extends ApiAbstract
|
class ApiJsonApplication extends ApiTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function getParameters(array $parameters = [])
|
public function getParameters(array $parameters = [])
|
||||||
|
@@ -11,7 +11,7 @@ use Alchemy\Phrasea\Model\Entities\Task;
|
|||||||
use Symfony\Component\HttpKernel\Client;
|
use Symfony\Component\HttpKernel\Client;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
abstract class ApiTestCase extends \PhraseanetWebTestCaseAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -22,35 +22,35 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
/**
|
/**
|
||||||
* @var \API_OAuth2_Token
|
* @var \API_OAuth2_Token
|
||||||
*/
|
*/
|
||||||
protected static $token;
|
private static $token;
|
||||||
protected static $APIrecord;
|
private static $APIrecord;
|
||||||
protected $record;
|
protected $record;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \API_OAuth2_Account
|
* @var \API_OAuth2_Account
|
||||||
*/
|
*/
|
||||||
protected static $account;
|
private static $account;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \API_OAuth2_Application
|
* @var \API_OAuth2_Application
|
||||||
*/
|
*/
|
||||||
protected static $oauthApplication;
|
private static $oauthApplication;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \API_OAuth2_Token
|
* @var \API_OAuth2_Token
|
||||||
*/
|
*/
|
||||||
protected static $adminToken;
|
private static $adminToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \API_OAuth2_Account
|
* @var \API_OAuth2_Account
|
||||||
*/
|
*/
|
||||||
protected static $adminAccount;
|
private static $adminAccount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \API_OAuth2_Application
|
* @var \API_OAuth2_Application
|
||||||
*/
|
*/
|
||||||
protected static $adminApplication;
|
private static $adminApplication;
|
||||||
protected static $databoxe_ids = [];
|
private static $databoxe_ids = [];
|
||||||
|
|
||||||
abstract public function getParameters(array $parameters = []);
|
abstract public function getParameters(array $parameters = []);
|
||||||
|
|
||||||
@@ -87,13 +87,13 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
self::$apiInitialized = true;
|
self::$apiInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!static::$APIrecord) {
|
if (!self::$APIrecord) {
|
||||||
$file = new File(self::$DI['app'], self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../../../files/test024.jpg'), self::$DI['collection']);
|
$file = new File(self::$DI['app'], self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../../../files/test024.jpg'), self::$DI['collection']);
|
||||||
static::$APIrecord = \record_adapter::createFromFile($file, self::$DI['app']);
|
self::$APIrecord = \record_adapter::createFromFile($file, self::$DI['app']);
|
||||||
static::$APIrecord->generate_subdefs(static::$APIrecord->get_databox(), self::$DI['app']);
|
self::$APIrecord->generate_subdefs(self::$APIrecord->get_databox(), self::$DI['app']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->record = static::$APIrecord;
|
$this->record = self::$APIrecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
@@ -107,8 +107,8 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
self::$adminApplication->delete();
|
self::$adminApplication->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
static::$APIrecord->delete();
|
self::$APIrecord->delete();
|
||||||
static::$APIrecord = null;
|
self::$APIrecord = null;
|
||||||
|
|
||||||
self::$apiInitialized = false;
|
self::$apiInitialized = false;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
$this->assertArrayHasKey('de', $databox['labels']);
|
$this->assertArrayHasKey('de', $databox['labels']);
|
||||||
$this->assertArrayHasKey('nl', $databox['labels']);
|
$this->assertArrayHasKey('nl', $databox['labels']);
|
||||||
$this->assertArrayHasKey('version', $databox);
|
$this->assertArrayHasKey('version', $databox);
|
||||||
static::$databoxe_ids[] = $databox['databox_id'];
|
self::$databoxe_ids[] = $databox['databox_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
public function testDataboxCollectionRoute()
|
public function testDataboxCollectionRoute()
|
||||||
{
|
{
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
foreach (static::$databoxe_ids as $databox_id) {
|
foreach (self::$databoxe_ids as $databox_id) {
|
||||||
$route = '/api/v1/databoxes/' . $databox_id . '/collections/';
|
$route = '/api/v1/databoxes/' . $databox_id . '/collections/';
|
||||||
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
|
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
public function testDataboxStatusRoute()
|
public function testDataboxStatusRoute()
|
||||||
{
|
{
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
foreach (static::$databoxe_ids as $databox_id) {
|
foreach (self::$databoxe_ids as $databox_id) {
|
||||||
$databox = self::$DI['app']['phraseanet.appbox']->get_databox($databox_id);
|
$databox = self::$DI['app']['phraseanet.appbox']->get_databox($databox_id);
|
||||||
$ref_status = $databox->get_statusbits();
|
$ref_status = $databox->get_statusbits();
|
||||||
$route = '/api/v1/databoxes/' . $databox_id . '/status/';
|
$route = '/api/v1/databoxes/' . $databox_id . '/status/';
|
||||||
@@ -723,7 +723,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
public function testDataboxMetadatasRoute()
|
public function testDataboxMetadatasRoute()
|
||||||
{
|
{
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
foreach (static::$databoxe_ids as $databox_id) {
|
foreach (self::$databoxe_ids as $databox_id) {
|
||||||
$databox = self::$DI['app']['phraseanet.appbox']->get_databox($databox_id);
|
$databox = self::$DI['app']['phraseanet.appbox']->get_databox($databox_id);
|
||||||
$ref_structure = $databox->get_meta_structure();
|
$ref_structure = $databox->get_meta_structure();
|
||||||
|
|
||||||
@@ -811,7 +811,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
public function testDataboxTermsOfUseRoute()
|
public function testDataboxTermsOfUseRoute()
|
||||||
{
|
{
|
||||||
$this->setToken(self::$token);
|
$this->setToken(self::$token);
|
||||||
foreach (static::$databoxe_ids as $databox_id) {
|
foreach (self::$databoxe_ids as $databox_id) {
|
||||||
$route = '/api/v1/databoxes/' . $databox_id . '/termsOfUse/';
|
$route = '/api/v1/databoxes/' . $databox_id . '/termsOfUse/';
|
||||||
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
|
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
|
||||||
|
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Application;
|
namespace Alchemy\Tests\Phrasea\Application;
|
||||||
|
|
||||||
class ApiYamlApplication extends ApiAbstract
|
class ApiYamlApplication extends ApiTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function getParameters(array $parameters = [])
|
public function getParameters(array $parameters = [])
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Application;
|
|||||||
|
|
||||||
use Symfony\Component\Process\Process;
|
use Symfony\Component\Process\Process;
|
||||||
|
|
||||||
class ConsoleAPITest extends \PHPUnit_Framework_TestCase
|
class ConsoleAPITest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideConsoleNames
|
* @dataProvider provideConsoleNames
|
||||||
|
@@ -181,7 +181,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_a_caption(array $headers = [])
|
private function get_a_caption(array $headers = [])
|
||||||
{
|
{
|
||||||
$token = self::$DI['record_1']->get_thumbnail()->get_permalink()->get_token();
|
$token = self::$DI['record_1']->get_thumbnail()->get_permalink()->get_token();
|
||||||
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . "/" . self::$DI['record_1']->get_record_id() . '/caption/?token='.$token;
|
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . "/" . self::$DI['record_1']->get_record_id() . '/caption/?token='.$token;
|
||||||
@@ -198,7 +198,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_a_permalinkBCcompatibility(array $headers = [])
|
private function get_a_permalinkBCcompatibility(array $headers = [])
|
||||||
{
|
{
|
||||||
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
||||||
$url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/';
|
$url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/';
|
||||||
@@ -224,7 +224,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_a_permaviewBCcompatibility(array $headers = [])
|
private function get_a_permaviewBCcompatibility(array $headers = [])
|
||||||
{
|
{
|
||||||
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
||||||
$url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/';
|
$url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/';
|
||||||
@@ -240,7 +240,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_a_permalink(array $headers = [])
|
private function get_a_permalink(array $headers = [])
|
||||||
{
|
{
|
||||||
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
||||||
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/whateverIwannt.jpg?token=' . $token . '';
|
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/whateverIwannt.jpg?token=' . $token . '';
|
||||||
@@ -257,7 +257,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_a_permaview(array $headers = [])
|
private function get_a_permaview(array $headers = [])
|
||||||
{
|
{
|
||||||
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
||||||
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/?token=' . $token . '';
|
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/?token=' . $token . '';
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Application;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
class RootApplicationTest extends \PHPUnit_Framework_TestCase
|
class RootApplicationTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideEnvironments
|
* @dataProvider provideEnvironments
|
||||||
|
@@ -15,16 +15,13 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
||||||
|
|
||||||
class ApplicationTest extends \PhraseanetPHPUnitAbstract
|
class ApplicationTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Application
|
* @covers Alchemy\Phrasea\Application
|
||||||
*/
|
*/
|
||||||
public function testDebug()
|
public function testDebug()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
|
||||||
$this->assertFalse($app['debug']);
|
|
||||||
|
|
||||||
$app = new Application('prod');
|
$app = new Application('prod');
|
||||||
$this->assertFalse($app['debug']);
|
$this->assertFalse($app['debug']);
|
||||||
|
|
||||||
@@ -363,7 +360,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getPreparedApp($tempDir)
|
private function getPreparedApp($tempDir)
|
||||||
{
|
{
|
||||||
$app = new Application('test');
|
$app = new Application('test');
|
||||||
$app['translator.cache-options'] = [
|
$app['translator.cache-options'] = [
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Authentication;
|
namespace Alchemy\Tests\Phrasea\Authentication;
|
||||||
|
|
||||||
class ACLProviderTest extends \PhraseanetPHPUnitAbstract
|
class ACLProviderTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testGetACL()
|
public function testGetACL()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\AccountCreator;
|
use Alchemy\Phrasea\Authentication\AccountCreator;
|
||||||
|
|
||||||
class AccountCreatorTest extends \PhraseanetPHPUnitAbstract
|
class AccountCreatorTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideEnabledOptions
|
* @dataProvider provideEnabledOptions
|
||||||
@@ -28,7 +28,7 @@ class AccountCreatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
|
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testCreateWithAnExistingMail()
|
public function testCreateWithAnExistingMail()
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ class AccountCreatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Exception\RuntimeException
|
* @expectedException \Alchemy\Phrasea\Exception\RuntimeException
|
||||||
*/
|
*/
|
||||||
public function testCreateWithDisabledCreator()
|
public function testCreateWithDisabledCreator()
|
||||||
{
|
{
|
||||||
|
@@ -7,14 +7,14 @@ use Alchemy\Phrasea\Authentication\Authenticator;
|
|||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
use Alchemy\Phrasea\Model\Entities\Session;
|
use Alchemy\Phrasea\Model\Entities\Session;
|
||||||
|
|
||||||
class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
class AuthenticatorTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Authentication\Authenticator::getUser
|
* @covers Alchemy\Phrasea\Authentication\Authenticator::getUser
|
||||||
*/
|
*/
|
||||||
public function testGetUser()
|
public function testGetUser()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$app['browser'] = $browser = $this->getBrowserMock();
|
$app['browser'] = $browser = $this->getBrowserMock();
|
||||||
$app['session'] = $session = $this->getSessionMock();
|
$app['session'] = $session = $this->getSessionMock();
|
||||||
@@ -28,7 +28,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testGetUserWhenAuthenticated()
|
public function testGetUserWhenAuthenticated()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$user = self::$DI['user'];
|
$user = self::$DI['user'];
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testSetUser()
|
public function testSetUser()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$app['browser'] = $browser = $this->getBrowserMock();
|
$app['browser'] = $browser = $this->getBrowserMock();
|
||||||
$app['session'] = $session = $this->getSessionMock();
|
$app['session'] = $session = $this->getSessionMock();
|
||||||
@@ -75,7 +75,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testOpenAccount()
|
public function testOpenAccount()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
$capturedSession = null;
|
$capturedSession = null;
|
||||||
|
|
||||||
$app['browser'] = $browser = $this->getBrowserMock();
|
$app['browser'] = $browser = $this->getBrowserMock();
|
||||||
@@ -126,7 +126,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testRefreshAccount()
|
public function testRefreshAccount()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$user = self::$DI['user'];
|
$user = self::$DI['user'];
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testRefreshAccountWithWrongSessionShouldThrowException()
|
public function testRefreshAccountWithWrongSessionShouldThrowException()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$user = self::$DI['user'];
|
$user = self::$DI['user'];
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testIsAuthenticated()
|
public function testIsAuthenticated()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$user = self::$DI['user'];
|
$user = self::$DI['user'];
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
*/
|
*/
|
||||||
public function testIsNotAuthenticated()
|
public function testIsNotAuthenticated()
|
||||||
{
|
{
|
||||||
$app = new Application();
|
$app = $this->loadApp();
|
||||||
|
|
||||||
$app['browser'] = $browser = $this->getBrowserMock();
|
$app['browser'] = $browser = $this->getBrowserMock();
|
||||||
$app['session'] = $session = $this->getSessionMock();
|
$app['session'] = $session = $this->getSessionMock();
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Context;
|
use Alchemy\Phrasea\Authentication\Context;
|
||||||
|
|
||||||
class ContextTest extends \PHPUnit_Framework_TestCase
|
class ContextTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testWithValidCOntext()
|
public function testWithValidCOntext()
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ class ContextTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
|
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testWithInvalidCOntext()
|
public function testWithInvalidCOntext()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Manager;
|
use Alchemy\Phrasea\Authentication\Manager;
|
||||||
|
|
||||||
class ManagerTest extends \PHPUnit_Framework_TestCase
|
class ManagerTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Authentication\Manager::openAccount
|
* @covers Alchemy\Phrasea\Authentication\Manager::openAccount
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Phrasea\Authentication\PersistentCookie;
|
|||||||
use Alchemy\Phrasea\Authentication\PersistentCookie\Manager;
|
use Alchemy\Phrasea\Authentication\PersistentCookie\Manager;
|
||||||
use Alchemy\Phrasea\Model\Entities\Session;
|
use Alchemy\Phrasea\Model\Entities\Session;
|
||||||
|
|
||||||
class ManagerTest extends \PHPUnit_Framework_TestCase
|
class ManagerTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Authentication\PersistentCookie\Manager::getSession
|
* @covers Alchemy\Phrasea\Authentication\PersistentCookie\Manager::getSession
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Phrasea\FailureHandledNativeAuthentication;
|
use Alchemy\Phrasea\Authentication\Phrasea\FailureHandledNativeAuthentication;
|
||||||
|
|
||||||
class FailureHandledNativeAuthenticationTest extends \PHPUnit_Framework_TestCase
|
class FailureHandledNativeAuthenticationTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testGetUsrIdWhenSuccessful()
|
public function testGetUsrIdWhenSuccessful()
|
||||||
{
|
{
|
||||||
|
@@ -7,7 +7,7 @@ use Alchemy\Phrasea\Model\Entities\AuthFailure;
|
|||||||
use Gedmo\Timestampable\TimestampableListener;
|
use Gedmo\Timestampable\TimestampableListener;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class FailureManagerTest extends \PhraseanetPHPUnitAbstract
|
class FailureManagerTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Authentication\Phrasea\FailureManager::saveFailure
|
* @covers Alchemy\Phrasea\Authentication\Phrasea\FailureManager::saveFailure
|
||||||
@@ -155,7 +155,7 @@ class FailureManagerTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Authentication\Exception\RequireCaptchaException
|
* @expectedException \Alchemy\Phrasea\Authentication\Exception\RequireCaptchaException
|
||||||
* @covers Alchemy\Phrasea\Authentication\Phrasea\FailureManager::checkFailures
|
* @covers Alchemy\Phrasea\Authentication\Phrasea\FailureManager::checkFailures
|
||||||
*/
|
*/
|
||||||
public function testCheckFailuresMoreThan9WithIncorrectCaptcha()
|
public function testCheckFailuresMoreThan9WithIncorrectCaptcha()
|
||||||
@@ -213,7 +213,7 @@ class FailureManagerTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Authentication\Exception\RequireCaptchaException
|
* @expectedException \Alchemy\Phrasea\Authentication\Exception\RequireCaptchaException
|
||||||
* @covers Alchemy\Phrasea\Authentication\Phrasea\FailureManager::checkFailures
|
* @covers Alchemy\Phrasea\Authentication\Phrasea\FailureManager::checkFailures
|
||||||
*/
|
*/
|
||||||
public function testCheckFailuresTrialsIsConfigurableOverThreshold()
|
public function testCheckFailuresTrialsIsConfigurableOverThreshold()
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Phrasea;
|
|||||||
use Alchemy\Phrasea\Authentication\Phrasea\NativeAuthentication;
|
use Alchemy\Phrasea\Authentication\Phrasea\NativeAuthentication;
|
||||||
use Alchemy\Phrasea\Authentication\Exception\AccountLockedException;
|
use Alchemy\Phrasea\Authentication\Exception\AccountLockedException;
|
||||||
|
|
||||||
class NativeAuthenticationTest extends \PHPUnit_Framework_TestCase
|
class NativeAuthenticationTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideReservedUsernames
|
* @dataProvider provideReservedUsernames
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Phrasea;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Phrasea\OldPasswordEncoder;
|
use Alchemy\Phrasea\Authentication\Phrasea\OldPasswordEncoder;
|
||||||
|
|
||||||
class OldPasswordEncoderTest extends \PHPUnit_Framework_TestCase
|
class OldPasswordEncoderTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider providePasswords
|
* @dataProvider providePasswords
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Phrasea;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Phrasea\PasswordEncoder;
|
use Alchemy\Phrasea\Authentication\Phrasea\PasswordEncoder;
|
||||||
|
|
||||||
class PasswordEncoderTest extends \PHPUnit_Framework_TestCase
|
class PasswordEncoderTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function providePasswords()
|
public function providePasswords()
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ class PasswordEncoderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideInvalidKeys
|
* @dataProvider provideInvalidKeys
|
||||||
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
|
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testFailureIfNoKey($key)
|
public function testFailureIfNoKey($key)
|
||||||
{
|
{
|
||||||
|
@@ -62,7 +62,7 @@ class FacebookTest extends ProviderTestCase
|
|||||||
return new Facebook($this->getFacebookMock(), $this->getUrlGeneratorMock());
|
return new Facebook($this->getFacebookMock(), $this->getUrlGeneratorMock());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function authenticate(ProviderInterface $provider)
|
protected function authenticateProvider(ProviderInterface $provider)
|
||||||
{
|
{
|
||||||
$provider->getFacebook()->expects($this->any())
|
$provider->getFacebook()->expects($this->any())
|
||||||
->method('getUser')
|
->method('getUser')
|
||||||
@@ -72,7 +72,7 @@ class FacebookTest extends ProviderTestCase
|
|||||||
protected function getProviderForSuccessIdentity()
|
protected function getProviderForSuccessIdentity()
|
||||||
{
|
{
|
||||||
$provider = $this->getProvider();
|
$provider = $this->getProvider();
|
||||||
$this->authenticate($provider);
|
$this->authenticateProvider($provider);
|
||||||
|
|
||||||
$facebook = $this->getMockBuilder('Facebook')
|
$facebook = $this->getMockBuilder('Facebook')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Provider;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Provider\Factory;
|
use Alchemy\Phrasea\Authentication\Provider\Factory;
|
||||||
|
|
||||||
class FactoryTest extends \PHPUnit_Framework_TestCase
|
class FactoryTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideNameAndOptions
|
* @dataProvider provideNameAndOptions
|
||||||
|
@@ -197,7 +197,7 @@ class GithubTest extends ProviderTestCase
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function authenticate(ProviderInterface $provider)
|
protected function authenticateProvider(ProviderInterface $provider)
|
||||||
{
|
{
|
||||||
$provider->getSession()->set('github.provider.id', 'github-id');
|
$provider->getSession()->set('github.provider.id', 'github-id');
|
||||||
}
|
}
|
||||||
|
@@ -236,7 +236,7 @@ class GooglePlusTest extends ProviderTestCase
|
|||||||
return $provider;
|
return $provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function authenticate(ProviderInterface $provider)
|
protected function authenticateProvider(ProviderInterface $provider)
|
||||||
{
|
{
|
||||||
$provider->getSession()->set('google-plus.provider.id', '12345678');
|
$provider->getSession()->set('google-plus.provider.id', '12345678');
|
||||||
}
|
}
|
||||||
|
@@ -271,7 +271,7 @@ class LinkedinTest extends ProviderTestCase
|
|||||||
return $this->getProvider();
|
return $this->getProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function authenticate(ProviderInterface $provider)
|
protected function authenticateProvider(ProviderInterface $provider)
|
||||||
{
|
{
|
||||||
$provider->getSession()->set('linkedin.provider.id', 'linkedin-id');
|
$provider->getSession()->set('linkedin.provider.id', 'linkedin-id');
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
|
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
|
||||||
use Symfony\Component\HttpFoundation\Session\Session;
|
use Symfony\Component\HttpFoundation\Session\Session;
|
||||||
|
|
||||||
abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
|
abstract class ProviderTestCase extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
protected $session;
|
protected $session;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideDataForFailingCallback
|
* @dataProvider provideDataForFailingCallback
|
||||||
* @expectedException Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
* @expectedException \Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
||||||
*/
|
*/
|
||||||
public function testOnCallbackWithFailure($provider, $request)
|
public function testOnCallbackWithFailure($provider, $request)
|
||||||
{
|
{
|
||||||
@@ -111,7 +111,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
public function testGetToken()
|
public function testGetToken()
|
||||||
{
|
{
|
||||||
$provider = $this->getProvider();
|
$provider = $this->getProvider();
|
||||||
$this->authenticate($provider);
|
$this->authenticateProvider($provider);
|
||||||
|
|
||||||
$token = $provider->getToken();
|
$token = $provider->getToken();
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
* @expectedException \Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
||||||
*/
|
*/
|
||||||
public function testGetTokenWhenNotAuthenticated()
|
public function testGetTokenWhenNotAuthenticated()
|
||||||
{
|
{
|
||||||
@@ -140,7 +140,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
* @expectedException \Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
||||||
*/
|
*/
|
||||||
public function testGetIdentityWhenNotAuthenticated()
|
public function testGetIdentityWhenNotAuthenticated()
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
$this->getProviderForLogout()->logout();
|
$this->getProviderForLogout()->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function authenticate(ProviderInterface $provider);
|
abstract protected function authenticateProvider(ProviderInterface $provider);
|
||||||
|
|
||||||
abstract protected function getProviderForAuthentication();
|
abstract protected function getProviderForAuthentication();
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Provider\Token;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
|
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
|
||||||
|
|
||||||
class IdentityTest extends \PHPUnit_Framework_TestCase
|
class IdentityTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testThatOffsetAreSetOnConstruct()
|
public function testThatOffsetAreSetOnConstruct()
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ class IdentityTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
|
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testThatGetOnUnknownArgThrowsAnException()
|
public function testThatGetOnUnknownArgThrowsAnException()
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ class IdentityTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testSet
|
* @depends testSet
|
||||||
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
|
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testRemoveThrowsAnException($identity)
|
public function testRemoveThrowsAnException($identity)
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Provider\Token;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Provider\Token\Token;
|
use Alchemy\Phrasea\Authentication\Provider\Token\Token;
|
||||||
|
|
||||||
class TokenTest extends \PHPUnit_Framework_TestCase
|
class TokenTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testGetIdAndProvider()
|
public function testGetIdAndProvider()
|
||||||
{
|
{
|
||||||
|
@@ -31,7 +31,7 @@ class TwitterTest extends ProviderTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
* @expectedException \Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
|
||||||
*/
|
*/
|
||||||
public function testAuthenticateWithFailure()
|
public function testAuthenticateWithFailure()
|
||||||
{
|
{
|
||||||
@@ -202,7 +202,7 @@ class TwitterTest extends ProviderTestCase
|
|||||||
return $provider;
|
return $provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function authenticate(ProviderInterface $provider)
|
protected function authenticateProvider(ProviderInterface $provider)
|
||||||
{
|
{
|
||||||
$provider->getSession()->set('twitter.provider.id', '12345');
|
$provider->getSession()->set('twitter.provider.id', '12345');
|
||||||
}
|
}
|
||||||
|
@@ -262,7 +262,7 @@ class ViadeoTest extends ProviderTestCase
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function authenticate(ProviderInterface $provider)
|
protected function authenticateProvider(ProviderInterface $provider)
|
||||||
{
|
{
|
||||||
$provider->getSession()->set('viadeo.provider.id', 'viadeo-id');
|
$provider->getSession()->set('viadeo.provider.id', 'viadeo-id');
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
|
|||||||
use Alchemy\Phrasea\Authentication\ProvidersCollection;
|
use Alchemy\Phrasea\Authentication\ProvidersCollection;
|
||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
|
|
||||||
class ProvidersCollectionTest extends \PHPUnit_Framework_TestCase
|
class ProvidersCollectionTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Authentication\ProvidersCollection::getIterator
|
* @covers Alchemy\Phrasea\Authentication\ProvidersCollection::getIterator
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
|
|||||||
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
|
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
|
||||||
use Alchemy\Phrasea\Authentication\SuggestionFinder;
|
use Alchemy\Phrasea\Authentication\SuggestionFinder;
|
||||||
|
|
||||||
class SuggestionFinderTest extends \PhraseanetPHPUnitAbstract
|
class SuggestionFinderTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testSuggestionIsFound()
|
public function testSuggestionIsFound()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Authentication\Token\TokenValidator;
|
use Alchemy\Phrasea\Authentication\Token\TokenValidator;
|
||||||
|
|
||||||
class TokenValidatorTest extends \PhraseanetPHPUnitAbstract
|
class TokenValidatorTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Authentication\TokenValidator::isValid
|
* @covers Alchemy\Phrasea\Authentication\TokenValidator::isValid
|
||||||
|
@@ -9,7 +9,7 @@ use PHPExiftool\Driver\Tag\IPTC\UniqueDocumentID;
|
|||||||
use PHPExiftool\Driver\Value\Mono;
|
use PHPExiftool\Driver\Value\Mono;
|
||||||
use PHPExiftool\Driver\Metadata\Metadata;
|
use PHPExiftool\Driver\Metadata\Metadata;
|
||||||
|
|
||||||
class FactoryTest extends \PhraseanetPHPUnitAbstract
|
class FactoryTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Attribute;
|
|||||||
use Alchemy\Phrasea\Border\Attribute\MetaField;
|
use Alchemy\Phrasea\Border\Attribute\MetaField;
|
||||||
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
||||||
|
|
||||||
class MetaFieldTest extends \PhraseanetPHPUnitAbstract
|
class MetaFieldTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MetaField
|
* @var MetaField
|
||||||
|
@@ -8,7 +8,7 @@ use PHPExiftool\Driver\Tag\IPTC\ObjectName;
|
|||||||
use PHPExiftool\Driver\Value\Mono;
|
use PHPExiftool\Driver\Value\Mono;
|
||||||
use PHPExiftool\Driver\Metadata\Metadata as ExiftoolMeta;
|
use PHPExiftool\Driver\Metadata\Metadata as ExiftoolMeta;
|
||||||
|
|
||||||
class MetadataTest extends \PhraseanetPHPUnitAbstract
|
class MetadataTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Metadata
|
* @var Metadata
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Attribute;
|
|||||||
use Alchemy\Phrasea\Border\Attribute\Status;
|
use Alchemy\Phrasea\Border\Attribute\Status;
|
||||||
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
||||||
|
|
||||||
class StatusTest extends \PhraseanetPHPUnitAbstract
|
class StatusTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Status
|
* @var Status
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Attribute;
|
|||||||
use Alchemy\Phrasea\Border\Attribute\Story;
|
use Alchemy\Phrasea\Border\Attribute\Story;
|
||||||
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
|
||||||
|
|
||||||
class StoryTest extends \PhraseanetPHPUnitAbstract
|
class StoryTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Story
|
* @var Story
|
||||||
|
@@ -8,7 +8,7 @@ use Alchemy\Phrasea\Application;
|
|||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
|
class AbstractCheckerTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var AbstractChecker
|
* @var AbstractChecker
|
||||||
@@ -48,7 +48,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
|
|||||||
public function getDataboxesCombinaison()
|
public function getDataboxesCombinaison()
|
||||||
{
|
{
|
||||||
$databox = $collection = null;
|
$databox = $collection = null;
|
||||||
$app = new Application('test');
|
$app = $this->loadApp();
|
||||||
|
|
||||||
foreach ($app['phraseanet.appbox']->get_databoxes() as $db) {
|
foreach ($app['phraseanet.appbox']->get_databoxes() as $db) {
|
||||||
if (! $collection) {
|
if (! $collection) {
|
||||||
@@ -99,7 +99,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
|
|||||||
public function getCollectionsCombinaison()
|
public function getCollectionsCombinaison()
|
||||||
{
|
{
|
||||||
$othercollection = $collection = null;
|
$othercollection = $collection = null;
|
||||||
$app = new Application('test');
|
$app = $this->loadApp();
|
||||||
$databoxes = $app['phraseanet.appbox']->get_databoxes();
|
$databoxes = $app['phraseanet.appbox']->get_databoxes();
|
||||||
if (count($databoxes) === 0) {
|
if (count($databoxes) === 0) {
|
||||||
$this->fail('Unable to find collections');
|
$this->fail('Unable to find collections');
|
||||||
@@ -181,7 +181,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
|
|||||||
public function getDataboxAndCollection()
|
public function getDataboxAndCollection()
|
||||||
{
|
{
|
||||||
$databox = $collection = null;
|
$databox = $collection = null;
|
||||||
$app = new Application('test');
|
$app = $this->loadApp();
|
||||||
|
|
||||||
foreach ($app['phraseanet.appbox']->get_databoxes() as $db) {
|
foreach ($app['phraseanet.appbox']->get_databoxes() as $db) {
|
||||||
if (! $databox) {
|
if (! $databox) {
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\Colorspace;
|
use Alchemy\Phrasea\Border\Checker\Colorspace;
|
||||||
|
|
||||||
class ColorspaceTest extends \PhraseanetPHPUnitAbstract
|
class ColorspaceTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Colorspace
|
* @var Colorspace
|
||||||
@@ -55,7 +55,7 @@ class ColorspaceTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testContructorInvalidArgumentException()
|
public function testContructorInvalidArgumentException()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\Dimension;
|
use Alchemy\Phrasea\Border\Checker\Dimension;
|
||||||
|
|
||||||
class DimensionTest extends \PhraseanetPHPUnitAbstract
|
class DimensionTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Dimension
|
* @var Dimension
|
||||||
@@ -115,7 +115,7 @@ class DimensionTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testContructorInvalidArgumentException()
|
public function testContructorInvalidArgumentException()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\Extension;
|
use Alchemy\Phrasea\Border\Checker\Extension;
|
||||||
|
|
||||||
class ExtensionTest extends \PhraseanetPHPUnitAbstract
|
class ExtensionTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Extension
|
* @var Extension
|
||||||
@@ -67,7 +67,7 @@ class ExtensionTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testContructorInvalidArgumentException()
|
public function testContructorInvalidArgumentException()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\Filename;
|
use Alchemy\Phrasea\Border\Checker\Filename;
|
||||||
|
|
||||||
class FilenameTest extends \PhraseanetPHPUnitAbstract
|
class FilenameTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Filename
|
* @var Filename
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\MediaType;
|
use Alchemy\Phrasea\Border\Checker\MediaType;
|
||||||
|
|
||||||
class MediaTypeTest extends \PhraseanetPHPUnitAbstract
|
class MediaTypeTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MediaType
|
* @var MediaType
|
||||||
@@ -51,7 +51,7 @@ class MediaTypeTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testContructorInvalidArgumentException()
|
public function testContructorInvalidArgumentException()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\Checker\Response;
|
use Alchemy\Phrasea\Border\Checker\Response;
|
||||||
use Alchemy\Tests\Tools\TranslatorMockTrait;
|
use Alchemy\Tests\Tools\TranslatorMockTrait;
|
||||||
|
|
||||||
class ResponseTest extends \PHPUnit_Framework_TestCase
|
class ResponseTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
use TranslatorMockTrait;
|
use TranslatorMockTrait;
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Border\Manager;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\Sha256;
|
use Alchemy\Phrasea\Border\Checker\Sha256;
|
||||||
|
|
||||||
class Sha256Test extends \PhraseanetPHPUnitAbstract
|
class Sha256Test extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Sha256
|
* @var Sha256
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Border\Checker\UUID;
|
use Alchemy\Phrasea\Border\Checker\UUID;
|
||||||
|
|
||||||
class UUIDTest extends \PhraseanetPHPUnitAbstract
|
class UUIDTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var UUID
|
* @var UUID
|
||||||
|
@@ -16,7 +16,7 @@ use PHPExiftool\Driver\Value\Multi;
|
|||||||
use PHPExiftool\Driver\Metadata\Metadata as PHPExiftoolMetadata;
|
use PHPExiftool\Driver\Metadata\Metadata as PHPExiftoolMetadata;
|
||||||
use Alchemy\Phrasea\Border\Attribute\Metadata;
|
use Alchemy\Phrasea\Border\Attribute\Metadata;
|
||||||
|
|
||||||
class FileTest extends \PhraseanetPHPUnitAbstract
|
class FileTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var File
|
* @var File
|
||||||
@@ -222,7 +222,7 @@ class FileTest extends \PhraseanetPHPUnitAbstract
|
|||||||
File::buildFromPathfile('unexistent.file', self::$DI['collection'], self::$DI['app']);
|
File::buildFromPathfile('unexistent.file', self::$DI['collection'], self::$DI['app']);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getMediaMock($type)
|
private function getMediaMock($type)
|
||||||
{
|
{
|
||||||
$mock = $this->getMockBuilder('\\MediaVorus\\Media\\Image')
|
$mock = $this->getMockBuilder('\\MediaVorus\\Media\\Image')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
|
@@ -21,8 +21,8 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
*/
|
*/
|
||||||
protected $object;
|
protected $object;
|
||||||
protected $session;
|
protected $session;
|
||||||
protected static $file1;
|
private static $file1;
|
||||||
protected static $file2;
|
private static $file2;
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border;
|
|||||||
use Alchemy\Phrasea\Border\Attribute\MetaField;
|
use Alchemy\Phrasea\Border\Attribute\MetaField;
|
||||||
use Alchemy\Phrasea\Border\MetaFieldsBag;
|
use Alchemy\Phrasea\Border\MetaFieldsBag;
|
||||||
|
|
||||||
class MetaFieldsBagTest extends \PhraseanetPHPUnitAbstract
|
class MetaFieldsBagTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MetaFieldsBag
|
* @var MetaFieldsBag
|
||||||
|
@@ -7,7 +7,7 @@ use PHPExiftool\Driver\Metadata\Metadata;
|
|||||||
use PHPExiftool\Driver\Value\Mono;
|
use PHPExiftool\Driver\Value\Mono;
|
||||||
use PHPExiftool\Driver\Value\Multi;
|
use PHPExiftool\Driver\Value\Multi;
|
||||||
|
|
||||||
class MetadataBagTest extends \PhraseanetPHPUnitAbstract
|
class MetadataBagTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MetadataBag
|
* @var MetadataBag
|
||||||
|
@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Border\Visa;
|
|||||||
use Alchemy\Phrasea\Border\Checker\Filename;
|
use Alchemy\Phrasea\Border\Checker\Filename;
|
||||||
use Alchemy\Phrasea\Border\Checker\Response;
|
use Alchemy\Phrasea\Border\Checker\Response;
|
||||||
|
|
||||||
class VisaTest extends \PhraseanetPHPUnitAbstract
|
class VisaTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\CLI;
|
use Alchemy\Phrasea\CLI;
|
||||||
|
|
||||||
class CLITest extends \PhraseanetPHPUnitAbstract
|
class CLITest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testsEmailWithoutQueue()
|
public function testsEmailWithoutQueue()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Cache\ApcCache;
|
use Alchemy\Phrasea\Cache\ApcCache;
|
||||||
|
|
||||||
class ApcCacheTest extends \PHPUnit_Framework_TestCase
|
class ApcCacheTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var ApcCache
|
* @var ApcCache
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Cache\ArrayCache;
|
use Alchemy\Phrasea\Cache\ArrayCache;
|
||||||
|
|
||||||
class ArrayCacheTest extends \PHPUnit_Framework_TestCase
|
class ArrayCacheTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var ArrayCache
|
* @var ArrayCache
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
use Alchemy\Phrasea\Cache\ConnectionFactory;
|
use Alchemy\Phrasea\Cache\ConnectionFactory;
|
||||||
use Alchemy\Phrasea\Cache\Factory;
|
use Alchemy\Phrasea\Cache\Factory;
|
||||||
|
|
||||||
class ConnectionFactoryTest extends \PHPUnit_Framework_TestCase
|
class ConnectionFactoryTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testGetRedisConnection()
|
public function testGetRedisConnection()
|
||||||
{
|
{
|
||||||
@@ -21,7 +21,7 @@ class ConnectionFactoryTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\PHrasea\Exception\RuntimeException
|
* @expectedException \Alchemy\PHrasea\Exception\RuntimeException
|
||||||
* @expectedExceptionMessage Redis instance with host 'unknown-host' and port '666' is not reachable
|
* @expectedExceptionMessage Redis instance with host 'unknown-host' and port '666' is not reachable
|
||||||
*/
|
*/
|
||||||
public function testGetInvalidRedisConnection()
|
public function testGetInvalidRedisConnection()
|
||||||
@@ -51,7 +51,7 @@ class ConnectionFactoryTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\PHrasea\Exception\RuntimeException
|
* @expectedException \Alchemy\PHrasea\Exception\RuntimeException
|
||||||
* @expectedExceptionMessage Memcached instance with host 'unknown-host' and port '666' is not reachable
|
* @expectedExceptionMessage Memcached instance with host 'unknown-host' and port '666' is not reachable
|
||||||
*/
|
*/
|
||||||
public function testGetInvalidMemcachedConnection()
|
public function testGetInvalidMemcachedConnection()
|
||||||
@@ -81,7 +81,7 @@ class ConnectionFactoryTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Alchemy\PHrasea\Exception\RuntimeException
|
* @expectedException \Alchemy\PHrasea\Exception\RuntimeException
|
||||||
* @expectedExceptionMessage Memcache instance with host 'unknown-host' and port '666' is not reachable
|
* @expectedExceptionMessage Memcache instance with host 'unknown-host' and port '666' is not reachable
|
||||||
*/
|
*/
|
||||||
public function testGetInvalidMemcacheConnection()
|
public function testGetInvalidMemcacheConnection()
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
use Alchemy\Phrasea\Cache\ConnectionFactory;
|
use Alchemy\Phrasea\Cache\ConnectionFactory;
|
||||||
use Alchemy\Phrasea\Cache\Factory;
|
use Alchemy\Phrasea\Cache\Factory;
|
||||||
|
|
||||||
class FactoryTest extends \PHPUnit_Framework_TestCase
|
class FactoryTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideCacheTypes
|
* @dataProvider provideCacheTypes
|
||||||
|
@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Cache\Manager;
|
|||||||
use Alchemy\Phrasea\Core\Configuration\Compiler;
|
use Alchemy\Phrasea\Core\Configuration\Compiler;
|
||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
|
|
||||||
class ManagerTest extends \PHPUnit_Framework_TestCase
|
class ManagerTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
private $file;
|
private $file;
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Cache\MemcacheCache;
|
use Alchemy\Phrasea\Cache\MemcacheCache;
|
||||||
|
|
||||||
class MemcacheCacheTest extends \PHPUnit_Framework_TestCase
|
class MemcacheCacheTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MemcacheCache
|
* @var MemcacheCache
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Cache\MemcachedCache;
|
use Alchemy\Phrasea\Cache\MemcachedCache;
|
||||||
|
|
||||||
class MemcachedCacheTest extends \PHPUnit_Framework_TestCase
|
class MemcachedCacheTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MemcacheCache
|
* @var MemcacheCache
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
|
|
||||||
use \Alchemy\Phrasea\Cache\RedisCache;
|
use \Alchemy\Phrasea\Cache\RedisCache;
|
||||||
|
|
||||||
class RedisTest extends \PhraseanetPHPUnitAbstract
|
class RedisTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testBasics()
|
public function testBasics()
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Cache\XcacheCache;
|
use Alchemy\Phrasea\Cache\XcacheCache;
|
||||||
|
|
||||||
class XcacheCacheTest extends \PHPUnit_Framework_TestCase
|
class XcacheCacheTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var XcacheCache
|
* @var XcacheCache
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\CheckConfig;
|
use Alchemy\Phrasea\Command\CheckConfig;
|
||||||
|
|
||||||
class CheckConfigTest extends \PhraseanetPHPUnitAbstract
|
class CheckConfigTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -6,14 +6,14 @@ use Alchemy\Phrasea\Command\Command;
|
|||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
class CommandTest extends \PHPUnit_Framework_TestCase
|
class CommandTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Command
|
* @var Command
|
||||||
*/
|
*/
|
||||||
protected $object;
|
protected $object;
|
||||||
|
|
||||||
protected function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
$this->object = new AbstractCommandTester('name');
|
$this->object = new AbstractCommandTester('name');
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Phrasea\Command\Compile;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Compile\Configuration;
|
use Alchemy\Phrasea\Command\Compile\Configuration;
|
||||||
|
|
||||||
class ConfigurationTest extends \PhraseanetPHPUnitAbstract
|
class ConfigurationTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testExecute()
|
public function testExecute()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Developer\BowerInstall;
|
use Alchemy\Phrasea\Command\Developer\BowerInstall;
|
||||||
|
|
||||||
class BowerInstallTest extends \PhraseanetPHPUnitAbstract
|
class BowerInstallTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Developer\ComposerInstall;
|
use Alchemy\Phrasea\Command\Developer\ComposerInstall;
|
||||||
|
|
||||||
class ComposerInstallTest extends \PhraseanetPHPUnitAbstract
|
class ComposerInstallTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Developer\InstallAll;
|
use Alchemy\Phrasea\Command\Developer\InstallAll;
|
||||||
|
|
||||||
class InstallAllTest extends \PhraseanetPHPUnitAbstract
|
class InstallAllTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
|
|||||||
use Alchemy\Phrasea\Command\Developer\Utils\BowerDriver;
|
use Alchemy\Phrasea\Command\Developer\Utils\BowerDriver;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
|
||||||
class BowerDriverTest extends \PHPUnit_Framework_TestCase
|
class BowerDriverTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
|
|||||||
use Alchemy\Phrasea\Command\Developer\Utils\ComposerDriver;
|
use Alchemy\Phrasea\Command\Developer\Utils\ComposerDriver;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
|
||||||
class ComposerDriverTest extends \PHPUnit_Framework_TestCase
|
class ComposerDriverTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
|
|||||||
use Alchemy\Phrasea\Command\Developer\Utils\GruntDriver;
|
use Alchemy\Phrasea\Command\Developer\Utils\GruntDriver;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
|
||||||
class GruntDriverTest extends \PHPUnit_Framework_TestCase
|
class GruntDriverTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Developer\Utils\RecessDriver;
|
use Alchemy\Phrasea\Command\Developer\Utils\RecessDriver;
|
||||||
|
|
||||||
class RecessDriverTest extends \PHPUnit_Framework_TestCase
|
class RecessDriverTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testGetCreate()
|
public function testGetCreate()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
|
|||||||
use Alchemy\Phrasea\Command\Developer\Utils\UglifyJsDriver;
|
use Alchemy\Phrasea\Command\Developer\Utils\UglifyJsDriver;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
|
||||||
class UglifyJsDriverTest extends \PHPUnit_Framework_TestCase
|
class UglifyJsDriverTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\MailTest;
|
use Alchemy\Phrasea\Command\MailTest;
|
||||||
|
|
||||||
class MailTestTest extends \PhraseanetPHPUnitAbstract
|
class MailTestTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testMailIsSent()
|
public function testMailIsSent()
|
||||||
{
|
{
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Command\Plugin;
|
namespace Alchemy\Tests\Phrasea\Command\Plugin;
|
||||||
|
|
||||||
class PluginCommandTestCase extends \PhraseanetPHPUnitAbstract
|
class PluginCommandTestCase extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
protected function createTemporaryFilesystemMock()
|
protected function createTemporaryFilesystemMock()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Setup\CheckEnvironment;
|
use Alchemy\Phrasea\Command\Setup\CheckEnvironment;
|
||||||
|
|
||||||
class CheckEnvironmentTest extends \PhraseanetPHPUnitAbstract
|
class CheckEnvironmentTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Setup\Install;
|
use Alchemy\Phrasea\Command\Setup\Install;
|
||||||
|
|
||||||
class InstallTest extends \PhraseanetPHPUnitAbstract
|
class InstallTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Setup;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Setup\PluginsReset;
|
use Alchemy\Phrasea\Command\Setup\PluginsReset;
|
||||||
|
|
||||||
class PluginResetTest extends \PhraseanetPHPUnitAbstract
|
class PluginResetTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRun()
|
public function testRun()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Setup;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator;
|
use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator;
|
||||||
|
|
||||||
class XSendFileMappingGeneratorTest extends \PhraseanetPHPUnitAbstract
|
class XSendFileMappingGeneratorTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideVariousOptions
|
* @dataProvider provideVariousOptions
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks;
|
use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks;
|
||||||
|
|
||||||
class SchedulerPauseTasksTest extends \PhraseanetPHPUnitAbstract
|
class SchedulerPauseTasksTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks;
|
use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks;
|
||||||
|
|
||||||
class SchedulerResumeTasksTest extends \PhraseanetPHPUnitAbstract
|
class SchedulerResumeTasksTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\SchedulerRun;
|
use Alchemy\Phrasea\Command\Task\SchedulerRun;
|
||||||
|
|
||||||
class SchedulerRunTest extends \PhraseanetPHPUnitAbstract
|
class SchedulerRunTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\SchedulerState;
|
use Alchemy\Phrasea\Command\Task\SchedulerState;
|
||||||
|
|
||||||
class SchedulerStateTest extends \PhraseanetPHPUnitAbstract
|
class SchedulerStateTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\TaskList;
|
use Alchemy\Phrasea\Command\Task\TaskList;
|
||||||
|
|
||||||
class TaskListTest extends \PhraseanetPHPUnitAbstract
|
class TaskListTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
use Alchemy\Phrasea\Command\Task\TaskRun;
|
use Alchemy\Phrasea\Command\Task\TaskRun;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskRunTest extends \PhraseanetPHPUnitAbstract
|
class TaskRunTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
use Alchemy\Phrasea\Command\Task\TaskStart;
|
use Alchemy\Phrasea\Command\Task\TaskStart;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskStartTest extends \PhraseanetPHPUnitAbstract
|
class TaskStartTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
use Alchemy\Phrasea\Command\Task\TaskState;
|
use Alchemy\Phrasea\Command\Task\TaskState;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskStateTest extends \PhraseanetPHPUnitAbstract
|
class TaskStateTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
|
|||||||
use Alchemy\Phrasea\Command\Task\TaskStop;
|
use Alchemy\Phrasea\Command\Task\TaskStop;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskStopTest extends \PhraseanetPHPUnitAbstract
|
class TaskStopTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function testRunWithoutProblems()
|
public function testRunWithoutProblems()
|
||||||
{
|
{
|
||||||
|
@@ -7,7 +7,7 @@ use Alchemy\Phrasea\Command\UpgradeDBDatas;
|
|||||||
use Alchemy\Phrasea\Command\Upgrade\Step31;
|
use Alchemy\Phrasea\Command\Upgrade\Step31;
|
||||||
use Alchemy\Phrasea\Command\Upgrade\Step35;
|
use Alchemy\Phrasea\Command\Upgrade\Step35;
|
||||||
|
|
||||||
class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
|
class UpgradeDBDatasTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var UpgradeDBDatas
|
* @var UpgradeDBDatas
|
||||||
@@ -17,7 +17,7 @@ class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Command\UpgradeDBDatas::__construct
|
* @covers Alchemy\Phrasea\Command\UpgradeDBDatas::__construct
|
||||||
*/
|
*/
|
||||||
protected function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
$this->object = new UpgradeDBDatas('commandname');
|
$this->object = new UpgradeDBDatas('commandname');
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals([], $this->object->getUpgrades());
|
$this->assertEquals([], $this->object->getUpgrades());
|
||||||
|
|
||||||
$upgrades = [
|
$upgrades = [
|
||||||
new Step31(new Application('test'))
|
new Step31($this->loadApp())
|
||||||
];
|
];
|
||||||
$this->object->setUpgrades($upgrades);
|
$this->object->setUpgrades($upgrades);
|
||||||
$this->assertEquals($upgrades, $this->object->getUpgrades());
|
$this->assertEquals($upgrades, $this->object->getUpgrades());
|
||||||
@@ -46,12 +46,12 @@ class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals([], $this->object->getUpgrades());
|
$this->assertEquals([], $this->object->getUpgrades());
|
||||||
|
|
||||||
$step31 = new Step31(new Application('test'));
|
$step31 = new Step31($this->loadApp());
|
||||||
$this->object->addUpgrade($step31);
|
$this->object->addUpgrade($step31);
|
||||||
|
|
||||||
$this->assertEquals([$step31], $this->object->getUpgrades());
|
$this->assertEquals([$step31], $this->object->getUpgrades());
|
||||||
|
|
||||||
$step35 = new Step35(new Application('test'));
|
$step35 = new Step35($this->loadApp());
|
||||||
$this->object->addUpgrade($step35);
|
$this->object->addUpgrade($step35);
|
||||||
|
|
||||||
$this->assertEquals([$step31, $step35], $this->object->getUpgrades());
|
$this->assertEquals([$step31, $step35], $this->object->getUpgrades());
|
||||||
|
@@ -9,11 +9,11 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected static $createdCollections = [];
|
private static $createdCollections = [];
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::$DI['app'] = new Application('test');
|
self::$DI['app'] = $this->loadApp();
|
||||||
self::dropDatabase();
|
self::dropDatabase();
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ class SearchEngineTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function getSearchEngines()
|
public function getSearchEngines()
|
||||||
{
|
{
|
||||||
$app = new Application('test');
|
$app = $this->loadApp();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
[new PhraseaEngine($app)],
|
[new PhraseaEngine($app)],
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Controller;
|
namespace Alchemy\Tests\Phrasea\Controller;
|
||||||
|
|
||||||
class MinifierTest extends \PhraseanetPHPUnitAbstract
|
class MinifierTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
|
@@ -8,7 +8,7 @@ namespace Alchemy\Tests\Phrasea\Controller\Prod;
|
|||||||
class ExportTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class ExportTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected $client;
|
protected $client;
|
||||||
protected static $GV_activeFTP;
|
private static $GV_activeFTP;
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
* @return Client A Client instance
|
* @return Client A Client instance
|
||||||
*/
|
*/
|
||||||
protected $client;
|
protected $client;
|
||||||
protected static $need_records = false;
|
private static $need_records = false;
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
|
@@ -16,7 +16,7 @@ class UploadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
*/
|
*/
|
||||||
protected $client;
|
protected $client;
|
||||||
protected $tmpFile;
|
protected $tmpFile;
|
||||||
protected static $need_records = false;
|
private static $need_records = false;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
|
@@ -32,7 +32,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(4, count($datas['result']));
|
$this->assertEquals(4, count($datas['result']));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkList($list, $owners = true, $users = true)
|
private function checkList($list, $owners = true, $users = true)
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('stdClass', $list);
|
$this->assertInstanceOf('stdClass', $list);
|
||||||
$this->assertObjectHasAttribute('name', $list);
|
$this->assertObjectHasAttribute('name', $list);
|
||||||
@@ -401,7 +401,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertTrue($datas['success']);
|
$this->assertTrue($datas['success']);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkOwner($owner)
|
private function checkOwner($owner)
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('stdClass', $owner);
|
$this->assertInstanceOf('stdClass', $owner);
|
||||||
$this->assertObjectHasAttribute('usr_id', $owner);
|
$this->assertObjectHasAttribute('usr_id', $owner);
|
||||||
@@ -414,7 +414,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertTrue(ctype_digit($owner->role));
|
$this->assertTrue(ctype_digit($owner->role));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkUser($user)
|
private function checkUser($user)
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('stdClass', $user);
|
$this->assertInstanceOf('stdClass', $user);
|
||||||
$this->assertObjectHasAttribute('usr_id', $user);
|
$this->assertObjectHasAttribute('usr_id', $user);
|
||||||
|
@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Controller\RecordsRequest;
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class RecordsRequestTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
class RecordsRequestTest extends \PhraseanetAuthenticatedTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
@@ -280,7 +280,7 @@ class RecordsRequestTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$this->assertEquals($story->getRecord(self::$DI['app'])->get_serialize_key(), $serialized);
|
$this->assertEquals($story->getRecord(self::$DI['app'])->get_serialize_key(), $serialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getStoryWZ()
|
private function getStoryWZ()
|
||||||
{
|
{
|
||||||
$story = new \Alchemy\Phrasea\Model\Entities\StoryWZ();
|
$story = new \Alchemy\Phrasea\Model\Entities\StoryWZ();
|
||||||
$story->setRecord(self::$DI['record_story_2']);
|
$story->setRecord(self::$DI['record_story_2']);
|
||||||
|
@@ -7,7 +7,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
|
|
||||||
class AccountTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class AccountTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
protected static $authorizedApp;
|
private static $authorizedApp;
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
|
@@ -25,19 +25,6 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
|
||||||
{
|
|
||||||
parent::setUpBeforeClass();
|
|
||||||
|
|
||||||
$application = new Application('test');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
|
||||||
{
|
|
||||||
parent::tearDownAfterClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testPublicFeedAggregated()
|
public function testPublicFeedAggregated()
|
||||||
{
|
{
|
||||||
$this->insertOneFeed(self::$DI['user'], "test", true);
|
$this->insertOneFeed(self::$DI['user'], "test", true);
|
||||||
@@ -51,7 +38,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
$this->evaluateAtom($response);
|
$this->evaluateAtom($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function evaluateAtom(Response $response)
|
private function evaluateAtom(Response $response)
|
||||||
{
|
{
|
||||||
$dom_doc = new \DOMDocument();
|
$dom_doc = new \DOMDocument();
|
||||||
$dom_doc->preserveWhiteSpace = false;
|
$dom_doc->preserveWhiteSpace = false;
|
||||||
@@ -68,7 +55,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
$this->assertEquals(1, $xpath->query('/atom:feed/atom:subtitle')->length);
|
$this->assertEquals(1, $xpath->query('/atom:feed/atom:subtitle')->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function evaluateGoodXML(Response $response)
|
private function evaluateGoodXML(Response $response)
|
||||||
{
|
{
|
||||||
$dom_doc = new \DOMDocument();
|
$dom_doc = new \DOMDocument();
|
||||||
$dom_doc->loadXML($response->getContent());
|
$dom_doc->loadXML($response->getContent());
|
||||||
@@ -76,7 +63,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
$this->assertEquals($dom_doc->saveXML(), $response->getContent());
|
$this->assertEquals($dom_doc->saveXML(), $response->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function evaluateResponse200(Response $response)
|
private function evaluateResponse200(Response $response)
|
||||||
{
|
{
|
||||||
$this->assertEquals(200, $response->getStatusCode(), 'Test status code ');
|
$this->assertEquals(200, $response->getStatusCode(), 'Test status code ');
|
||||||
$this->assertEquals('UTF-8', $response->getCharset(), 'Test charset response');
|
$this->assertEquals('UTF-8', $response->getCharset(), 'Test charset response');
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Core\CLIProvider;
|
namespace Alchemy\Tests\Phrasea\Core\CLIProvider;
|
||||||
|
|
||||||
abstract class ServiceProviderTestCase extends \PhraseanetPHPUnitAbstract
|
abstract class ServiceProviderTestCase extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user