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

@@ -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