Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Simple quotes to avoid problems with character escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
scheb committed May 7, 2016
1 parent ebd34d9 commit a68d5ba
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions Tests/Command/GoogleSecretCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function setUp()
private function createContainerStub($hasService, $googleAuthenticator)
{
//Stub the container
$container = $this->getMock("Symfony\Component\DependencyInjection\ContainerInterface");
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container
->expects($this->any())
->method('has')
Expand All @@ -45,8 +45,8 @@ public function execute_googleAuthenticationDisabled_throwException()
{
$container = $this->createContainerStub(false, null);
$this->command->setContainer($container);
$input = $this->getMock("Symfony\Component\Console\Input\InputInterface");
$output = $this->getMock("Symfony\Component\Console\Output\OutputInterface");
$input = $this->getMock('Symfony\Component\Console\Input\InputInterface');
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
$this->command->execute($input, $output);
}

Expand All @@ -56,7 +56,7 @@ public function execute_googleAuthenticationDisabled_throwException()
public function execute_googleAuthenticationEnabled_returnSecret()
{
//Mock the GoogleAuthenticator
$googleAuthenticator = $this->getMockBuilder("Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticator")
$googleAuthenticator = $this->getMockBuilder('Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticator')
->disableOriginalConstructor()
->getMock();
$googleAuthenticator
Expand All @@ -68,8 +68,8 @@ public function execute_googleAuthenticationEnabled_returnSecret()
$container = $this->createContainerStub(true, $googleAuthenticator);
$this->command->setContainer($container);

$input = $this->getMock("Symfony\Component\Console\Input\InputInterface");
$output = $this->getMock("Symfony\Component\Console\Output\OutputInterface");
$input = $this->getMock('Symfony\Component\Console\Input\InputInterface');
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');

//Expect some output
$output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ProviderCompilerPassTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->container = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerBuilder")
$this->container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -63,10 +63,10 @@ private function stubContainerService($taggedServices)

private function createServiceDefinition()
{
$this->registryDefinition = $this->getMockBuilder("Symfony\Component\DependencyInjection\Definition")
$this->registryDefinition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')
->disableOriginalConstructor()
->getMock();
$this->voterDefinition = $this->getMockBuilder("Symfony\Component\DependencyInjection\Definition")
$this->voterDefinition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')
->disableOriginalConstructor()
->getMock();
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/DependencyInjection/SchebTwoFactorExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function load_emptyConfig_setDefaultValues()
$this->assertParameter('trusted_computer', 'scheb_two_factor.trusted_computer.cookie_name');
$this->assertParameter(5184000, 'scheb_two_factor.trusted_computer.cookie_lifetime');
$this->assertParameter(false, 'scheb_two_factor.trusted_computer.cookie_secure');
$this->assertParameter(array("Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken"), 'scheb_two_factor.security_tokens');
$this->assertParameter(array('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken'), 'scheb_two_factor.security_tokens');
$this->assertParameter(array(), 'scheb_two_factor.ip_whitelist');
$this->assertParameter(null, 'scheb_two_factor.exclude_pattern');
}
Expand All @@ -79,7 +79,7 @@ public function load_fullConfig_setConfigValues()
$this->assertParameter('trusted_cookie', 'scheb_two_factor.trusted_computer.cookie_name');
$this->assertParameter(2592000, 'scheb_two_factor.trusted_computer.cookie_lifetime');
$this->assertParameter(true, 'scheb_two_factor.trusted_computer.cookie_secure');
$this->assertParameter(array("Symfony\Component\Security\Core\Authentication\Token\SomeToken"), 'scheb_two_factor.security_tokens');
$this->assertParameter(array('Symfony\Component\Security\Core\Authentication\Token\SomeToken'), 'scheb_two_factor.security_tokens');
$this->assertParameter(array('127.0.0.1'), 'scheb_two_factor.ip_whitelist');
$this->assertParameter('excludePattern', 'scheb_two_factor.exclude_pattern');
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Mailer/AuthCodeMailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function setUp()
public function sendAuthCode_withUserObject_sendEmail()
{
//Stub the user object
$user = $this->getMock("Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface");
$user = $this->getMock('Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface');
$user
->expects($this->any())
->method('getEmail')
Expand Down
2 changes: 1 addition & 1 deletion Tests/Model/DoctrinePersisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DoctrinePersisterTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->em = $this->getMockBuilder("Doctrine\ORM\EntityManager")
$this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
->disableOriginalConstructor()
->setMethods(array('persist', 'flush'))
->getMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class BackupCodeValidatorTest extends \PHPUnit_Framework_TestCase

public function setUp()
{
$this->backupCodeValidator = $this->getMockBuilder("Scheb\TwoFactorBundle\Security\TwoFactor\Backup\BackupCodeValidator")
$this->backupCodeValidator = $this->getMockBuilder('Scheb\TwoFactorBundle\Security\TwoFactor\Backup\BackupCodeValidator')
->disableOriginalConstructor()
->getMock();

$this->decoratedValidator = $this->getMock("Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Email\Validation\CodeValidatorInterface");
$this->decoratedValidator = $this->getMock('Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Email\Validation\CodeValidatorInterface');

$this->validator = new BackupCodeValidator($this->backupCodeValidator, $this->decoratedValidator);
}
Expand All @@ -39,7 +39,7 @@ public function setUp()
*/
public function checkCode_validBackupCode_notCallDecoratedValidator()
{
$user = $this->getMock("Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Provider\Email\Validation\TestableUserClass");
$user = $this->getMock('Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Provider\Email\Validation\TestableUserClass');

//Expect backup code validator to be called
$this->backupCodeValidator
Expand All @@ -62,7 +62,7 @@ public function checkCode_validBackupCode_notCallDecoratedValidator()
*/
public function checkCode_invalidBackupCode_callDecoratedValidator()
{
$user = $this->getMock("Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Provider\Email\Validation\TestableUserClass");
$user = $this->getMock('Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Provider\Email\Validation\TestableUserClass');

//Expect backup code validator to be called
$this->backupCodeValidator
Expand All @@ -87,7 +87,7 @@ public function checkCode_invalidBackupCode_callDecoratedValidator()
*/
public function checkCode_backupCodesNotSupported_callDecoratedValidator()
{
$user = $this->getMock("Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface");
$user = $this->getMock('Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface');

//Expect backup code validator NOT to be called
$this->backupCodeValidator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function setUp()
public function checkCode_validateCode_returnBoolean($code, $input, $expectedReturnValue)
{
//Mock the user object
$user = $this->getMock("Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface");
$user = $this->getMock('Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface');
$user
->expects($this->once())
->method('getEmailAuthCode')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function isTrustedComputer_cookieSet_validateTrustedCodes()
*/
public function isTrustedComputer_validTrustedCode_returnTrue()
{
$user = $this->getMock("Scheb\TwoFactorBundle\Model\TrustedComputerInterface");
$user = $this->getMock('Scheb\TwoFactorBundle\Model\TrustedComputerInterface');
$request = $this->createRequest('trustedCode1;trustedCode2');

//Stub the User object
Expand Down

0 comments on commit a68d5ba

Please sign in to comment.