Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify tests #90

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/Faker/Calculator/IbanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public function validatorProvider()
['YY24KIHB12476423125915947930915268', true],
['ZZ25VLQT382332233206588011313776421', true],


['AL4721211009000000023569874', false],
['AD120001203020035910010', false],
['AT61190430023457320', false],
Expand Down Expand Up @@ -289,12 +288,13 @@ public function mod97Provider()
];

// 0-200
for ($i = 0; $i < 200; $i++) {
$return[] = [(string)$i, $i % 97];
for ($i = 0; $i < 200; ++$i) {
$return[] = [(string) $i, $i % 97];
}

return $return;
}

/**
* @dataProvider mod97Provider
*/
Expand Down
2 changes: 1 addition & 1 deletion test/Faker/Calculator/InnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function checksumProvider()
['500109285', '3'],
['500109285', '3'],
['500109285', '3'],
['027615723', '1']
['027615723', '1'],
];
}

Expand Down
28 changes: 14 additions & 14 deletions test/Faker/Calculator/LuhnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ final class LuhnTest extends TestCase
{
public function checkDigitProvider()
{
return array(
array('7992739871', '3'),
array('3852000002323', '7'),
array('37144963539843', '1'),
array('561059108101825', '0'),
array('601100099013942', '4'),
array('510510510510510', '0'),
array(7992739871, '3'),
array(3852000002323, '7'),
array('37144963539843', '1'),
array('561059108101825', '0'),
array('601100099013942', '4'),
array('510510510510510', '0')
);
return [
['7992739871', '3'],
['3852000002323', '7'],
['37144963539843', '1'],
['561059108101825', '0'],
['601100099013942', '4'],
['510510510510510', '0'],
[7992739871, '3'],
[3852000002323, '7'],
['37144963539843', '1'],
['561059108101825', '0'],
['601100099013942', '4'],
['510510510510510', '0'],
];
}

/**
Expand Down
4 changes: 3 additions & 1 deletion test/Faker/Calculator/TCNoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ public function checksumProvider()
['350630743', '78'],
['550600932', '88'],
['487932947', '70'],
['168113862', '40']
['168113862', '40'],
];
}

/**
* @dataProvider checksumProvider
*
* @param $tcNo
* @param $checksum
*/
Expand All @@ -44,6 +45,7 @@ public function validatorProvider()

/**
* @dataProvider validatorProvider
*
* @param $tcNo
* @param $isValid
*/
Expand Down
2 changes: 1 addition & 1 deletion test/Faker/DefaultGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class DefaultGeneratorTest extends TestCase
{
public function testGeneratorReturnsNullByDefault()
{
$generator = new DefaultGenerator;
$generator = new DefaultGenerator();
self::assertNull($generator->value);
}

Expand Down
6 changes: 3 additions & 3 deletions test/Faker/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public function testFormatCallsFormatterOnProvider()

public function testFormatTransfersArgumentsToFormatter()
{
$this->faker = new Generator;
$this->faker = new Generator();
$provider = new FooProvider();
$this->faker->addProvider($provider);
self::assertEquals('bazfoo', $this->faker->format('fooFormatterWithArguments', array('foo')));
self::assertEquals('bazfoo', $this->faker->format('fooFormatterWithArguments', ['foo']));
}

public function testParseReturnsSameStringWhenItContainsNoCurlyBraces()
Expand Down Expand Up @@ -119,7 +119,7 @@ public function fooFormatter()

public function fooFormatterWithArguments($value = '')
{
return 'baz' . $value;
return 'baz'.$value;
}
}

Expand Down
Loading