Fix unit test names, property and function visibility

This commit is contained in:
Romain Neutron
2013-12-06 10:26:54 +01:00
parent 804caccc73
commit a3b1ae7163
313 changed files with 510 additions and 534 deletions

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\ACL;
use Alchemy\Phrasea\ACL\BasketACL;
class BasketACLTest extends \PhraseanetPHPUnitAbstract
class BasketACLTest extends \PhraseanetTestCase
{
public function testOwnerIsOwner()
{

View File

@@ -4,9 +4,8 @@ namespace Alchemy\Tests\Phrasea\Application;
use Symfony\Component\HttpFoundation\Response;
class ApiJSONPApplication extends ApiAbstract
class ApiJSONPApplication extends ApiTestCase
{
protected function evaluateResponseBadRequest(Response $response)
{
$this->assertEquals('UTF-8', $response->getCharset(), 'Test charset response');

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Application;
class ApiJsonApplication extends ApiAbstract
class ApiJsonApplication extends ApiTestCase
{
public function getParameters(array $parameters = [])

View File

@@ -11,7 +11,7 @@ use Alchemy\Phrasea\Model\Entities\Task;
use Symfony\Component\HttpKernel\Client;
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
*/
protected static $token;
protected static $APIrecord;
private static $token;
private static $APIrecord;
protected $record;
/**
* @var \API_OAuth2_Account
*/
protected static $account;
private static $account;
/**
* @var \API_OAuth2_Application
*/
protected static $oauthApplication;
private static $oauthApplication;
/**
* @var \API_OAuth2_Token
*/
protected static $adminToken;
private static $adminToken;
/**
* @var \API_OAuth2_Account
*/
protected static $adminAccount;
private static $adminAccount;
/**
* @var \API_OAuth2_Application
*/
protected static $adminApplication;
protected static $databoxe_ids = [];
private static $adminApplication;
private static $databoxe_ids = [];
abstract public function getParameters(array $parameters = []);
@@ -87,13 +87,13 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
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']);
static::$APIrecord = \record_adapter::createFromFile($file, self::$DI['app']);
static::$APIrecord->generate_subdefs(static::$APIrecord->get_databox(), self::$DI['app']);
self::$APIrecord = \record_adapter::createFromFile($file, 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()
@@ -107,8 +107,8 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
self::$adminApplication->delete();
}
static::$APIrecord->delete();
static::$APIrecord = null;
self::$APIrecord->delete();
self::$APIrecord = null;
self::$apiInitialized = false;
@@ -191,7 +191,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
$this->assertArrayHasKey('de', $databox['labels']);
$this->assertArrayHasKey('nl', $databox['labels']);
$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()
{
$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/';
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
@@ -669,7 +669,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
public function testDataboxStatusRoute()
{
$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);
$ref_status = $databox->get_statusbits();
$route = '/api/v1/databoxes/' . $databox_id . '/status/';
@@ -723,7 +723,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
public function testDataboxMetadatasRoute()
{
$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);
$ref_structure = $databox->get_meta_structure();
@@ -811,7 +811,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
public function testDataboxTermsOfUseRoute()
{
$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/';
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Application;
class ApiYamlApplication extends ApiAbstract
class ApiYamlApplication extends ApiTestCase
{
public function getParameters(array $parameters = [])

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Application;
use Symfony\Component\Process\Process;
class ConsoleAPITest extends \PHPUnit_Framework_TestCase
class ConsoleAPITest extends \PhraseanetTestCase
{
/**
* @dataProvider provideConsoleNames

View File

@@ -181,7 +181,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$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();
$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());
}
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();
$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());
}
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();
$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());
}
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();
$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());
}
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();
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/?token=' . $token . '';

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Application;
use Alchemy\Phrasea\Application;
class RootApplicationTest extends \PHPUnit_Framework_TestCase
class RootApplicationTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideEnvironments

View File

@@ -15,16 +15,13 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
class ApplicationTest extends \PhraseanetPHPUnitAbstract
class ApplicationTest extends \PhraseanetTestCase
{
/**
* @covers Alchemy\Phrasea\Application
*/
public function testDebug()
{
$app = new Application();
$this->assertFalse($app['debug']);
$app = new Application('prod');
$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['translator.cache-options'] = [

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Authentication;
class ACLProviderTest extends \PhraseanetPHPUnitAbstract
class ACLProviderTest extends \PhraseanetTestCase
{
public function testGetACL()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\AccountCreator;
class AccountCreatorTest extends \PhraseanetPHPUnitAbstract
class AccountCreatorTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideEnabledOptions
@@ -28,7 +28,7 @@ class AccountCreatorTest extends \PhraseanetPHPUnitAbstract
}
/**
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
*/
public function testCreateWithAnExistingMail()
{
@@ -40,7 +40,7 @@ class AccountCreatorTest extends \PhraseanetPHPUnitAbstract
}
/**
* @expectedException Alchemy\Phrasea\Exception\RuntimeException
* @expectedException \Alchemy\Phrasea\Exception\RuntimeException
*/
public function testCreateWithDisabledCreator()
{

View File

@@ -7,14 +7,14 @@ use Alchemy\Phrasea\Authentication\Authenticator;
use Alchemy\Phrasea\Exception\RuntimeException;
use Alchemy\Phrasea\Model\Entities\Session;
class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
class AuthenticatorTest extends \PhraseanetTestCase
{
/**
* @covers Alchemy\Phrasea\Authentication\Authenticator::getUser
*/
public function testGetUser()
{
$app = new Application();
$app = $this->loadApp();
$app['browser'] = $browser = $this->getBrowserMock();
$app['session'] = $session = $this->getSessionMock();
@@ -28,7 +28,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testGetUserWhenAuthenticated()
{
$app = new Application();
$app = $this->loadApp();
$user = self::$DI['user'];
@@ -53,7 +53,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testSetUser()
{
$app = new Application();
$app = $this->loadApp();
$app['browser'] = $browser = $this->getBrowserMock();
$app['session'] = $session = $this->getSessionMock();
@@ -75,7 +75,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testOpenAccount()
{
$app = new Application();
$app = $this->loadApp();
$capturedSession = null;
$app['browser'] = $browser = $this->getBrowserMock();
@@ -126,7 +126,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testRefreshAccount()
{
$app = new Application();
$app = $this->loadApp();
$user = self::$DI['user'];
@@ -168,7 +168,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testRefreshAccountWithWrongSessionShouldThrowException()
{
$app = new Application();
$app = $this->loadApp();
$user = self::$DI['user'];
@@ -239,7 +239,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testIsAuthenticated()
{
$app = new Application();
$app = $this->loadApp();
$user = self::$DI['user'];
@@ -264,7 +264,7 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
*/
public function testIsNotAuthenticated()
{
$app = new Application();
$app = $this->loadApp();
$app['browser'] = $browser = $this->getBrowserMock();
$app['session'] = $session = $this->getSessionMock();

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\Context;
class ContextTest extends \PHPUnit_Framework_TestCase
class ContextTest extends \PhraseanetTestCase
{
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()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\Manager;
class ManagerTest extends \PHPUnit_Framework_TestCase
class ManagerTest extends \PhraseanetTestCase
{
/**
* @covers Alchemy\Phrasea\Authentication\Manager::openAccount

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Phrasea\Authentication\PersistentCookie;
use Alchemy\Phrasea\Authentication\PersistentCookie\Manager;
use Alchemy\Phrasea\Model\Entities\Session;
class ManagerTest extends \PHPUnit_Framework_TestCase
class ManagerTest extends \PhraseanetTestCase
{
/**
* @covers Alchemy\Phrasea\Authentication\PersistentCookie\Manager::getSession

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea;
use Alchemy\Phrasea\Authentication\Phrasea\FailureHandledNativeAuthentication;
class FailureHandledNativeAuthenticationTest extends \PHPUnit_Framework_TestCase
class FailureHandledNativeAuthenticationTest extends \PhraseanetTestCase
{
public function testGetUsrIdWhenSuccessful()
{

View File

@@ -7,7 +7,7 @@ use Alchemy\Phrasea\Model\Entities\AuthFailure;
use Gedmo\Timestampable\TimestampableListener;
use Symfony\Component\HttpFoundation\Request;
class FailureManagerTest extends \PhraseanetPHPUnitAbstract
class FailureManagerTest extends \PhraseanetTestCase
{
/**
* @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
*/
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
*/
public function testCheckFailuresTrialsIsConfigurableOverThreshold()

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Phrasea;
use Alchemy\Phrasea\Authentication\Phrasea\NativeAuthentication;
use Alchemy\Phrasea\Authentication\Exception\AccountLockedException;
class NativeAuthenticationTest extends \PHPUnit_Framework_TestCase
class NativeAuthenticationTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideReservedUsernames

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Phrasea;
use Alchemy\Phrasea\Authentication\Phrasea\OldPasswordEncoder;
class OldPasswordEncoderTest extends \PHPUnit_Framework_TestCase
class OldPasswordEncoderTest extends \PhraseanetTestCase
{
/**
* @dataProvider providePasswords

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Phrasea;
use Alchemy\Phrasea\Authentication\Phrasea\PasswordEncoder;
class PasswordEncoderTest extends \PHPUnit_Framework_TestCase
class PasswordEncoderTest extends \PhraseanetTestCase
{
public function providePasswords()
{
@@ -31,7 +31,7 @@ class PasswordEncoderTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider provideInvalidKeys
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
*/
public function testFailureIfNoKey($key)
{

View File

@@ -62,7 +62,7 @@ class FacebookTest extends ProviderTestCase
return new Facebook($this->getFacebookMock(), $this->getUrlGeneratorMock());
}
protected function authenticate(ProviderInterface $provider)
protected function authenticateProvider(ProviderInterface $provider)
{
$provider->getFacebook()->expects($this->any())
->method('getUser')
@@ -72,7 +72,7 @@ class FacebookTest extends ProviderTestCase
protected function getProviderForSuccessIdentity()
{
$provider = $this->getProvider();
$this->authenticate($provider);
$this->authenticateProvider($provider);
$facebook = $this->getMockBuilder('Facebook')
->disableOriginalConstructor()

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Provider;
use Alchemy\Phrasea\Authentication\Provider\Factory;
class FactoryTest extends \PHPUnit_Framework_TestCase
class FactoryTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideNameAndOptions

View File

@@ -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');
}

View File

@@ -236,7 +236,7 @@ class GooglePlusTest extends ProviderTestCase
return $provider;
}
protected function authenticate(ProviderInterface $provider)
protected function authenticateProvider(ProviderInterface $provider)
{
$provider->getSession()->set('google-plus.provider.id', '12345678');
}

View File

@@ -271,7 +271,7 @@ class LinkedinTest extends ProviderTestCase
return $this->getProvider();
}
protected function authenticate(ProviderInterface $provider)
protected function authenticateProvider(ProviderInterface $provider)
{
$provider->getSession()->set('linkedin.provider.id', 'linkedin-id');
}

View File

@@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
use Symfony\Component\HttpFoundation\Session\Session;
abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
abstract class ProviderTestCase extends \PhraseanetTestCase
{
protected $session;
@@ -101,7 +101,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
/**
* @dataProvider provideDataForFailingCallback
* @expectedException Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
* @expectedException \Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
*/
public function testOnCallbackWithFailure($provider, $request)
{
@@ -111,7 +111,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
public function testGetToken()
{
$provider = $this->getProvider();
$this->authenticate($provider);
$this->authenticateProvider($provider);
$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()
{
@@ -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()
{
@@ -192,7 +192,7 @@ abstract class ProviderTestCase extends \PHPUnit_Framework_TestCase
$this->getProviderForLogout()->logout();
}
abstract protected function authenticate(ProviderInterface $provider);
abstract protected function authenticateProvider(ProviderInterface $provider);
abstract protected function getProviderForAuthentication();

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Provider\Token;
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
class IdentityTest extends \PHPUnit_Framework_TestCase
class IdentityTest extends \PhraseanetTestCase
{
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()
{
@@ -103,7 +103,7 @@ class IdentityTest extends \PHPUnit_Framework_TestCase
/**
* @depends testSet
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
* @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
*/
public function testRemoveThrowsAnException($identity)
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication\Provider\Token;
use Alchemy\Phrasea\Authentication\Provider\Token\Token;
class TokenTest extends \PHPUnit_Framework_TestCase
class TokenTest extends \PhraseanetTestCase
{
public function testGetIdAndProvider()
{

View File

@@ -31,7 +31,7 @@ class TwitterTest extends ProviderTestCase
}
/**
* @expectedException Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
* @expectedException \Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException
*/
public function testAuthenticateWithFailure()
{
@@ -202,7 +202,7 @@ class TwitterTest extends ProviderTestCase
return $provider;
}
protected function authenticate(ProviderInterface $provider)
protected function authenticateProvider(ProviderInterface $provider)
{
$provider->getSession()->set('twitter.provider.id', '12345');
}

View File

@@ -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');
}

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\ProvidersCollection;
use Alchemy\Phrasea\Exception\InvalidArgumentException;
class ProvidersCollectionTest extends \PHPUnit_Framework_TestCase
class ProvidersCollectionTest extends \PhraseanetTestCase
{
/**
* @covers Alchemy\Phrasea\Authentication\ProvidersCollection::getIterator

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
use Alchemy\Phrasea\Authentication\SuggestionFinder;
class SuggestionFinderTest extends \PhraseanetPHPUnitAbstract
class SuggestionFinderTest extends \PhraseanetTestCase
{
public function testSuggestionIsFound()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\Token\TokenValidator;
class TokenValidatorTest extends \PhraseanetPHPUnitAbstract
class TokenValidatorTest extends \PhraseanetTestCase
{
/**
* @covers Alchemy\Phrasea\Authentication\TokenValidator::isValid

View File

@@ -9,7 +9,7 @@ use PHPExiftool\Driver\Tag\IPTC\UniqueDocumentID;
use PHPExiftool\Driver\Value\Mono;
use PHPExiftool\Driver\Metadata\Metadata;
class FactoryTest extends \PhraseanetPHPUnitAbstract
class FactoryTest extends \PhraseanetTestCase
{
/**

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Attribute;
use Alchemy\Phrasea\Border\Attribute\MetaField;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
class MetaFieldTest extends \PhraseanetPHPUnitAbstract
class MetaFieldTest extends \PhraseanetTestCase
{
/**
* @var MetaField

View File

@@ -8,7 +8,7 @@ use PHPExiftool\Driver\Tag\IPTC\ObjectName;
use PHPExiftool\Driver\Value\Mono;
use PHPExiftool\Driver\Metadata\Metadata as ExiftoolMeta;
class MetadataTest extends \PhraseanetPHPUnitAbstract
class MetadataTest extends \PhraseanetTestCase
{
/**
* @var Metadata

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Attribute;
use Alchemy\Phrasea\Border\Attribute\Status;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
class StatusTest extends \PhraseanetPHPUnitAbstract
class StatusTest extends \PhraseanetTestCase
{
/**
* @var Status

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Attribute;
use Alchemy\Phrasea\Border\Attribute\Story;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
class StoryTest extends \PhraseanetPHPUnitAbstract
class StoryTest extends \PhraseanetTestCase
{
/**
* @var Story

View File

@@ -8,7 +8,7 @@ use Alchemy\Phrasea\Application;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Translation\TranslatorInterface;
class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
class AbstractCheckerTest extends \PhraseanetTestCase
{
/**
* @var AbstractChecker
@@ -48,7 +48,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
public function getDataboxesCombinaison()
{
$databox = $collection = null;
$app = new Application('test');
$app = $this->loadApp();
foreach ($app['phraseanet.appbox']->get_databoxes() as $db) {
if (! $collection) {
@@ -99,7 +99,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
public function getCollectionsCombinaison()
{
$othercollection = $collection = null;
$app = new Application('test');
$app = $this->loadApp();
$databoxes = $app['phraseanet.appbox']->get_databoxes();
if (count($databoxes) === 0) {
$this->fail('Unable to find collections');
@@ -181,7 +181,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
public function getDataboxAndCollection()
{
$databox = $collection = null;
$app = new Application('test');
$app = $this->loadApp();
foreach ($app['phraseanet.appbox']->get_databoxes() as $db) {
if (! $databox) {

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\Colorspace;
class ColorspaceTest extends \PhraseanetPHPUnitAbstract
class ColorspaceTest extends \PhraseanetTestCase
{
/**
* @var Colorspace
@@ -55,7 +55,7 @@ class ColorspaceTest extends \PhraseanetPHPUnitAbstract
}
/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testContructorInvalidArgumentException()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\Dimension;
class DimensionTest extends \PhraseanetPHPUnitAbstract
class DimensionTest extends \PhraseanetTestCase
{
/**
* @var Dimension
@@ -115,7 +115,7 @@ class DimensionTest extends \PhraseanetPHPUnitAbstract
}
/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testContructorInvalidArgumentException()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\Extension;
class ExtensionTest extends \PhraseanetPHPUnitAbstract
class ExtensionTest extends \PhraseanetTestCase
{
/**
* @var Extension
@@ -67,7 +67,7 @@ class ExtensionTest extends \PhraseanetPHPUnitAbstract
}
/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testContructorInvalidArgumentException()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\Filename;
class FilenameTest extends \PhraseanetPHPUnitAbstract
class FilenameTest extends \PhraseanetTestCase
{
/**
* @var Filename

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\MediaType;
class MediaTypeTest extends \PhraseanetPHPUnitAbstract
class MediaTypeTest extends \PhraseanetTestCase
{
/**
* @var MediaType
@@ -51,7 +51,7 @@ class MediaTypeTest extends \PhraseanetPHPUnitAbstract
}
/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testContructorInvalidArgumentException()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\Checker\Response;
use Alchemy\Tests\Tools\TranslatorMockTrait;
class ResponseTest extends \PHPUnit_Framework_TestCase
class ResponseTest extends \PhraseanetTestCase
{
use TranslatorMockTrait;

View File

@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Border\Manager;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\Sha256;
class Sha256Test extends \PhraseanetPHPUnitAbstract
class Sha256Test extends \PhraseanetTestCase
{
/**
* @var Sha256

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border\Checker;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Checker\UUID;
class UUIDTest extends \PhraseanetPHPUnitAbstract
class UUIDTest extends \PhraseanetTestCase
{
/**
* @var UUID

View File

@@ -16,7 +16,7 @@ use PHPExiftool\Driver\Value\Multi;
use PHPExiftool\Driver\Metadata\Metadata as PHPExiftoolMetadata;
use Alchemy\Phrasea\Border\Attribute\Metadata;
class FileTest extends \PhraseanetPHPUnitAbstract
class FileTest extends \PhraseanetTestCase
{
/**
* @var File
@@ -222,7 +222,7 @@ class FileTest extends \PhraseanetPHPUnitAbstract
File::buildFromPathfile('unexistent.file', self::$DI['collection'], self::$DI['app']);
}
protected function getMediaMock($type)
private function getMediaMock($type)
{
$mock = $this->getMockBuilder('\\MediaVorus\\Media\\Image')
->disableOriginalConstructor()

View File

@@ -21,8 +21,8 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
*/
protected $object;
protected $session;
protected static $file1;
protected static $file2;
private static $file1;
private static $file2;
public static function setUpBeforeClass()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Border;
use Alchemy\Phrasea\Border\Attribute\MetaField;
use Alchemy\Phrasea\Border\MetaFieldsBag;
class MetaFieldsBagTest extends \PhraseanetPHPUnitAbstract
class MetaFieldsBagTest extends \PhraseanetTestCase
{
/**
* @var MetaFieldsBag

View File

@@ -7,7 +7,7 @@ use PHPExiftool\Driver\Metadata\Metadata;
use PHPExiftool\Driver\Value\Mono;
use PHPExiftool\Driver\Value\Multi;
class MetadataBagTest extends \PhraseanetPHPUnitAbstract
class MetadataBagTest extends \PhraseanetTestCase
{
/**
* @var MetadataBag

View File

@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Border\Visa;
use Alchemy\Phrasea\Border\Checker\Filename;
use Alchemy\Phrasea\Border\Checker\Response;
class VisaTest extends \PhraseanetPHPUnitAbstract
class VisaTest extends \PhraseanetTestCase
{
/**

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea;
use Alchemy\Phrasea\CLI;
class CLITest extends \PhraseanetPHPUnitAbstract
class CLITest extends \PhraseanetTestCase
{
public function testsEmailWithoutQueue()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\ApcCache;
class ApcCacheTest extends \PHPUnit_Framework_TestCase
class ApcCacheTest extends \PhraseanetTestCase
{
/**
* @var ApcCache

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\ArrayCache;
class ArrayCacheTest extends \PHPUnit_Framework_TestCase
class ArrayCacheTest extends \PhraseanetTestCase
{
/**
* @var ArrayCache

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\ConnectionFactory;
use Alchemy\Phrasea\Cache\Factory;
class ConnectionFactoryTest extends \PHPUnit_Framework_TestCase
class ConnectionFactoryTest extends \PhraseanetTestCase
{
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
*/
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
*/
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
*/
public function testGetInvalidMemcacheConnection()

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\ConnectionFactory;
use Alchemy\Phrasea\Cache\Factory;
class FactoryTest extends \PHPUnit_Framework_TestCase
class FactoryTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideCacheTypes

View File

@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Cache\Manager;
use Alchemy\Phrasea\Core\Configuration\Compiler;
use Alchemy\Phrasea\Exception\RuntimeException;
class ManagerTest extends \PHPUnit_Framework_TestCase
class ManagerTest extends \PhraseanetTestCase
{
private $file;

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\MemcacheCache;
class MemcacheCacheTest extends \PHPUnit_Framework_TestCase
class MemcacheCacheTest extends \PhraseanetTestCase
{
/**
* @var MemcacheCache

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\MemcachedCache;
class MemcachedCacheTest extends \PHPUnit_Framework_TestCase
class MemcachedCacheTest extends \PhraseanetTestCase
{
/**
* @var MemcacheCache

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use \Alchemy\Phrasea\Cache\RedisCache;
class RedisTest extends \PhraseanetPHPUnitAbstract
class RedisTest extends \PhraseanetTestCase
{
public function testBasics()

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Cache;
use Alchemy\Phrasea\Cache\XcacheCache;
class XcacheCacheTest extends \PHPUnit_Framework_TestCase
class XcacheCacheTest extends \PhraseanetTestCase
{
/**
* @var XcacheCache

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
use Alchemy\Phrasea\Command\CheckConfig;
class CheckConfigTest extends \PhraseanetPHPUnitAbstract
class CheckConfigTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -6,14 +6,14 @@ use Alchemy\Phrasea\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CommandTest extends \PHPUnit_Framework_TestCase
class CommandTest extends \PhraseanetTestCase
{
/**
* @var Command
*/
protected $object;
protected function setUp()
public function setUp()
{
$this->object = new AbstractCommandTester('name');
}

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Phrasea\Command\Compile;
use Alchemy\Phrasea\Command\Compile\Configuration;
class ConfigurationTest extends \PhraseanetPHPUnitAbstract
class ConfigurationTest extends \PhraseanetTestCase
{
public function testExecute()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper;
use Alchemy\Phrasea\Command\Developer\BowerInstall;
class BowerInstallTest extends \PhraseanetPHPUnitAbstract
class BowerInstallTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper;
use Alchemy\Phrasea\Command\Developer\ComposerInstall;
class ComposerInstallTest extends \PhraseanetPHPUnitAbstract
class ComposerInstallTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper;
use Alchemy\Phrasea\Command\Developer\InstallAll;
class InstallAllTest extends \PhraseanetPHPUnitAbstract
class InstallAllTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
use Alchemy\Phrasea\Command\Developer\Utils\BowerDriver;
use Symfony\Component\Process\PhpExecutableFinder;
class BowerDriverTest extends \PHPUnit_Framework_TestCase
class BowerDriverTest extends \PhraseanetTestCase
{
public function testCreate()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
use Alchemy\Phrasea\Command\Developer\Utils\ComposerDriver;
use Symfony\Component\Process\PhpExecutableFinder;
class ComposerDriverTest extends \PHPUnit_Framework_TestCase
class ComposerDriverTest extends \PhraseanetTestCase
{
public function testCreate()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
use Alchemy\Phrasea\Command\Developer\Utils\GruntDriver;
use Symfony\Component\Process\PhpExecutableFinder;
class GruntDriverTest extends \PHPUnit_Framework_TestCase
class GruntDriverTest extends \PhraseanetTestCase
{
public function testCreate()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
use Alchemy\Phrasea\Command\Developer\Utils\RecessDriver;
class RecessDriverTest extends \PHPUnit_Framework_TestCase
class RecessDriverTest extends \PhraseanetTestCase
{
public function testGetCreate()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
use Alchemy\Phrasea\Command\Developer\Utils\UglifyJsDriver;
use Symfony\Component\Process\PhpExecutableFinder;
class UglifyJsDriverTest extends \PHPUnit_Framework_TestCase
class UglifyJsDriverTest extends \PhraseanetTestCase
{
public function testCreate()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
use Alchemy\Phrasea\Command\MailTest;
class MailTestTest extends \PhraseanetPHPUnitAbstract
class MailTestTest extends \PhraseanetTestCase
{
public function testMailIsSent()
{

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Command\Plugin;
class PluginCommandTestCase extends \PhraseanetPHPUnitAbstract
class PluginCommandTestCase extends \PhraseanetTestCase
{
protected function createTemporaryFilesystemMock()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
use Alchemy\Phrasea\Command\Setup\CheckEnvironment;
class CheckEnvironmentTest extends \PhraseanetPHPUnitAbstract
class CheckEnvironmentTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command;
use Alchemy\Phrasea\Command\Setup\Install;
class InstallTest extends \PhraseanetPHPUnitAbstract
class InstallTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Setup;
use Alchemy\Phrasea\Command\Setup\PluginsReset;
class PluginResetTest extends \PhraseanetPHPUnitAbstract
class PluginResetTest extends \PhraseanetTestCase
{
public function testRun()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Setup;
use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator;
class XSendFileMappingGeneratorTest extends \PhraseanetPHPUnitAbstract
class XSendFileMappingGeneratorTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideVariousOptions

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks;
class SchedulerPauseTasksTest extends \PhraseanetPHPUnitAbstract
class SchedulerPauseTasksTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks;
class SchedulerResumeTasksTest extends \PhraseanetPHPUnitAbstract
class SchedulerResumeTasksTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\SchedulerRun;
class SchedulerRunTest extends \PhraseanetPHPUnitAbstract
class SchedulerRunTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\SchedulerState;
class SchedulerStateTest extends \PhraseanetPHPUnitAbstract
class SchedulerStateTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\TaskList;
class TaskListTest extends \PhraseanetPHPUnitAbstract
class TaskListTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\TaskRun;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskRunTest extends \PhraseanetPHPUnitAbstract
class TaskRunTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\TaskStart;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskStartTest extends \PhraseanetPHPUnitAbstract
class TaskStartTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\TaskState;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskStateTest extends \PhraseanetPHPUnitAbstract
class TaskStateTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Task\TaskStop;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskStopTest extends \PhraseanetPHPUnitAbstract
class TaskStopTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{

View File

@@ -7,7 +7,7 @@ use Alchemy\Phrasea\Command\UpgradeDBDatas;
use Alchemy\Phrasea\Command\Upgrade\Step31;
use Alchemy\Phrasea\Command\Upgrade\Step35;
class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
class UpgradeDBDatasTest extends \PhraseanetTestCase
{
/**
* @var UpgradeDBDatas
@@ -17,7 +17,7 @@ class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
/**
* @covers Alchemy\Phrasea\Command\UpgradeDBDatas::__construct
*/
protected function setUp()
public function setUp()
{
$this->object = new UpgradeDBDatas('commandname');
}
@@ -33,7 +33,7 @@ class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
$this->assertEquals([], $this->object->getUpgrades());
$upgrades = [
new Step31(new Application('test'))
new Step31($this->loadApp())
];
$this->object->setUpgrades($upgrades);
$this->assertEquals($upgrades, $this->object->getUpgrades());
@@ -46,12 +46,12 @@ class UpgradeDBDatasTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals([], $this->object->getUpgrades());
$step31 = new Step31(new Application('test'));
$step31 = new Step31($this->loadApp());
$this->object->addUpgrade($step31);
$this->assertEquals([$step31], $this->object->getUpgrades());
$step35 = new Step35(new Application('test'));
$step35 = new Step35($this->loadApp());
$this->object->addUpgrade($step35);
$this->assertEquals([$step31, $step35], $this->object->getUpgrades());

View File

@@ -9,11 +9,11 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
protected $client;
protected static $createdCollections = [];
private static $createdCollections = [];
public function setUp()
{
self::$DI['app'] = new Application('test');
self::$DI['app'] = $this->loadApp();
self::dropDatabase();
parent::setUp();
}

View File

@@ -35,7 +35,7 @@ class SearchEngineTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function getSearchEngines()
{
$app = new Application('test');
$app = $this->loadApp();
return [
[new PhraseaEngine($app)],

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Controller;
class MinifierTest extends \PhraseanetPHPUnitAbstract
class MinifierTest extends \PhraseanetTestCase
{
public function setUp()
{

View File

@@ -8,7 +8,7 @@ namespace Alchemy\Tests\Phrasea\Controller\Prod;
class ExportTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
protected $client;
protected static $GV_activeFTP;
private static $GV_activeFTP;
public function tearDown()
{

View File

@@ -13,7 +13,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
* @return Client A Client instance
*/
protected $client;
protected static $need_records = false;
private static $need_records = false;
public function tearDown()
{

View File

@@ -16,7 +16,7 @@ class UploadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
*/
protected $client;
protected $tmpFile;
protected static $need_records = false;
private static $need_records = false;
public function setUp()
{

View File

@@ -32,7 +32,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$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->assertObjectHasAttribute('name', $list);
@@ -401,7 +401,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$this->assertTrue($datas['success']);
}
protected function checkOwner($owner)
private function checkOwner($owner)
{
$this->assertInstanceOf('stdClass', $owner);
$this->assertObjectHasAttribute('usr_id', $owner);
@@ -414,7 +414,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$this->assertTrue(ctype_digit($owner->role));
}
protected function checkUser($user)
private function checkUser($user)
{
$this->assertInstanceOf('stdClass', $user);
$this->assertObjectHasAttribute('usr_id', $user);

View File

@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Application;
use Symfony\Component\HttpFoundation\Request;
class RecordsRequestTest extends \PhraseanetPHPUnitAuthenticatedAbstract
class RecordsRequestTest extends \PhraseanetAuthenticatedTestCase
{
public static function setUpBeforeClass()
@@ -280,7 +280,7 @@ class RecordsRequestTest extends \PhraseanetPHPUnitAuthenticatedAbstract
$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->setRecord(self::$DI['record_story_2']);

View File

@@ -7,7 +7,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class AccountTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
protected static $authorizedApp;
private static $authorizedApp;
public static function setUpBeforeClass()
{

View File

@@ -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()
{
$this->insertOneFeed(self::$DI['user'], "test", true);
@@ -51,7 +38,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
$this->evaluateAtom($response);
}
protected function evaluateAtom(Response $response)
private function evaluateAtom(Response $response)
{
$dom_doc = new \DOMDocument();
$dom_doc->preserveWhiteSpace = false;
@@ -68,7 +55,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
$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->loadXML($response->getContent());
@@ -76,7 +63,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract
$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('UTF-8', $response->getCharset(), 'Test charset response');

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Core\CLIProvider;
abstract class ServiceProviderTestCase extends \PhraseanetPHPUnitAbstract
abstract class ServiceProviderTestCase extends \PhraseanetTestCase
{
/**
* @test

Some files were not shown because too many files have changed in this diff Show More