Skip to content

Commit

Permalink
Merge pull request #35 from sstok/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
sstok committed Jan 14, 2015
2 parents 234e56c + e168a92 commit 15c34f9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Command/BlacklistCommonCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$file = realpath($input->getOption('file'));

if (!file_exists($file)) {
$output->writeln('<error>Unable to read passwords list. No such file: ' . $input->getOption('file') . '</error>');
$output->writeln('<error>Unable to read passwords list. No such file: '.$input->getOption('file').'</error>');

return;
}

if (!is_readable($file)) {
$output->writeln('<error>Unable to read passwords list. Access denied: ' . $input->getOption('file') . '</error>');
$output->writeln('<error>Unable to read passwords list. Access denied: '.$input->getOption('file').'</error>');

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function load(array $configs, ContainerBuilder $container)

$container->setAlias('rollerworks_password_strength.blacklist_provider', $config['blacklist']['default_provider']);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('blacklist.xml');

if (isset($config['blacklist']['providers']['sqlite'])) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Blacklist/SqliteProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function setUpBeforeClass()
@unlink(self::$dbFile);
}

self::$provider = new SqliteProvider('sqlite:' . self::$dbFile);
self::$provider = new SqliteProvider('sqlite:'.self::$dbFile);
}

public static function tearDownAfterClass()
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/BlacklistCommandTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function setUpBeforeClass()
@unlink(self::$dbFile);
}

$sqliteProvider = new SqliteProvider('sqlite:' . self::$dbFile);
$sqliteProvider = new SqliteProvider('sqlite:'.self::$dbFile);

self::$container = new Container();
self::$container->set('rollerworks_password_strength.blacklist.provider.sqlite', $sqliteProvider);
Expand Down
8 changes: 4 additions & 4 deletions tests/Command/BlacklistDeleteCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testReadFromFile()

$commandTester = new CommandTester($command);

$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list1.txt'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list1.txt'));
$this->assertRegExp('/Successfully removed 2 password\(s\) from your blacklist database/', $commandTester->getDisplay());

$this->assertFalse($this->getProvider()->isBlacklisted('test'));
Expand All @@ -136,14 +136,14 @@ public function testImportExistingFromFile()

$commandTester = new CommandTester($command);

$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list1.txt'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list1.txt'));
$this->assertRegExp('/Successfully removed 2 password\(s\) from your blacklist database/', $commandTester->getDisplay());

$this->assertFalse($this->getProvider()->isBlacklisted('test'));
$this->assertFalse($this->getProvider()->isBlacklisted('foobar'));
$this->assertTrue($this->getProvider()->isBlacklisted('kaboom'));

$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list1.txt'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list1.txt'));
$this->assertRegExp('/Successfully removed 0 password\(s\) from your blacklist database/', $commandTester->getDisplay());
}

Expand Down Expand Up @@ -207,7 +207,7 @@ public function testImportFromEmptyFile()

$commandTester = new CommandTester($command);
$commandTester->execute(
array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list2.txt')
array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list2.txt')
);

$this->assertRegExp('/Passwords list seems empty, are you sure this is the correct file\?/', $commandTester->getDisplay());
Expand Down
8 changes: 4 additions & 4 deletions tests/Command/BlacklistUpdateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testImportFromFile()
$this->assertFalse($this->getProvider()->isBlacklisted('foobar'));

$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list1.txt'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list1.txt'));

$this->assertTrue($this->getProvider()->isBlacklisted('test'));
$this->assertTrue($this->getProvider()->isBlacklisted('foobar'));
Expand All @@ -128,15 +128,15 @@ public function testImportExistingFromFile()
$this->assertFalse($this->getProvider()->isBlacklisted('foobar'));

$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list1.txt'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list1.txt'));

$this->assertTrue($this->getProvider()->isBlacklisted('test'));
$this->assertTrue($this->getProvider()->isBlacklisted('foobar'));
$this->assertRegExp('/Successfully added 2 password\(s\) to your blacklist database/', $commandTester->getDisplay());

$this->assertTrue($this->getProvider()->isBlacklisted('test'));
$this->assertTrue($this->getProvider()->isBlacklisted('foobar'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list1.txt'));
$commandTester->execute(array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list1.txt'));

$this->assertTrue($this->getProvider()->isBlacklisted('test'));
$this->assertTrue($this->getProvider()->isBlacklisted('foobar'));
Expand Down Expand Up @@ -202,7 +202,7 @@ public function testImportFromEmptyFile()

$commandTester = new CommandTester($command);
$commandTester->execute(
array('command' => $command->getName(), '--file' => __DIR__ . '/../fixtures/passwords-list2.txt')
array('command' => $command->getName(), '--file' => __DIR__.'/../fixtures/passwords-list2.txt')
);

$this->assertRegExp('/Passwords list seems empty, are you sure this is the correct file\?/', $commandTester->getDisplay());
Expand Down
2 changes: 1 addition & 1 deletion tests/DependencyInjection/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testLoadWithChainConfiguration()
protected function createContainer()
{
$container = new ContainerBuilder(new ParameterBag(array(
'kernel.cache_dir' => __DIR__ . '/.cache' ,
'kernel.cache_dir' => __DIR__.'/.cache',
'kernel.charset' => 'UTF-8',
'kernel.debug' => false,
)));
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

error_reporting(E_ALL | E_STRICT);

if (!file_exists(__DIR__ . '/../vendor/autoload.php')) {
if (!file_exists(__DIR__.'/../vendor/autoload.php')) {
throw new \RuntimeException('Did not find vendor/autoload.php. Please Install vendors using command: composer.phar install --dev');
}

/**
* @var $loader ClassLoader
*/
$loader = require __DIR__ . '/../vendor/autoload.php';
$loader = require __DIR__.'/../vendor/autoload.php';

0 comments on commit 15c34f9

Please sign in to comment.