Skip to content

Commit fdcddf9

Browse files
committed
Update tests.
1 parent 0ad4a4d commit fdcddf9

20 files changed

+87
-89
lines changed

tests/src/Generators/CombinationsTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class PermutationsTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Combinations
1313
*/
1414
final class CombinationsTest extends AbstractTest
1515
{
@@ -30,16 +30,16 @@ public function testCombinationsClass($input, $expected)
3030
{
3131
$combinations = new Combinations($input['dataset'], $input['length']);
3232

33-
$this->assertSame($input['dataset'], $combinations->getDataset());
34-
$this->assertSame($input['length'], $combinations->getLength());
35-
$this->assertEquals(
33+
static::assertSame($input['dataset'], $combinations->getDataset());
34+
static::assertSame($input['length'], $combinations->getLength());
35+
static::assertEquals(
3636
$expected['dataset'],
3737
$combinations->toArray(),
3838
'$canonicalize = true',
3939
$delta = 0.0,
4040
$maxDepth = 10,
4141
$canonicalize = true
4242
);
43-
$this->assertSame($expected['count'], $combinations->count());
43+
static::assertSame($expected['count'], $combinations->count());
4444
}
4545
}

tests/src/Generators/FibonacciTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class FibonacciTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Fibonacci
1313
*/
1414
final class FibonacciTest extends AbstractTest
1515
{
@@ -31,8 +31,8 @@ public function testFibonacci($input, $expected)
3131
$prime = new Fibonacci();
3232
$prime->setMaxLimit(1000);
3333

34-
$this->assertSame($expected['count'], $prime->count());
35-
$this->assertEquals(
34+
static::assertSame($expected['count'], $prime->count());
35+
static::assertEquals(
3636
$expected['dataset'],
3737
$prime->toArray(),
3838
'$canonicalize = true',

tests/src/Generators/FiniteGroupTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class FiniteGroupTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\FiniteGroup
1313
*/
1414
final class FiniteGroupTest extends AbstractTest
1515
{
@@ -28,19 +28,17 @@ final class FiniteGroupTest extends AbstractTest
2828
*/
2929
public function testFiniteGroup($input, $expected)
3030
{
31-
/*
3231
$prime = new FiniteGroup();
3332
$prime->setSize($input['size']);
3433

35-
$this->assertSame($expected['count'], $prime->count());
36-
$this->assertEquals(
34+
static::assertSame($expected['count'], $prime->count());
35+
static::assertEquals(
3736
$expected['dataset'],
3837
$prime->toArray(),
3938
'$canonicalize = true',
4039
$delta = 0.0,
4140
$maxDepth = 10,
4241
$canonicalize = true
4342
);
44-
*/
4543
}
4644
}

tests/src/Generators/PerfectTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class PerfectTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Perfect
1313
*/
1414
final class PerfectTest extends AbstractTest
1515
{
@@ -33,13 +33,13 @@ public function testPerfect($input, $expected)
3333
$perfect->setMaxLimit($input['max']);
3434

3535
if (2 > $input['min']) {
36-
$this->assertSame(2, $perfect->getMinLimit());
36+
static::assertSame(2, $perfect->getMinLimit());
3737
} else {
38-
$this->assertSame($input['min'], $perfect->getMinLimit());
38+
static::assertSame($input['min'], $perfect->getMinLimit());
3939
}
40-
$this->assertSame($input['max'], $perfect->getMaxLimit());
41-
$this->assertSame($expected['count'], $perfect->count());
42-
$this->assertEquals(
40+
static::assertSame($input['max'], $perfect->getMaxLimit());
41+
static::assertSame($expected['count'], $perfect->count());
42+
static::assertEquals(
4343
$expected['dataset'],
4444
$perfect->toArray(),
4545
'$canonicalize = true',

tests/src/Generators/PermutationsTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class PermutationsTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Permutations
1313
*/
1414
final class PermutationsTest extends AbstractTest
1515
{
@@ -31,10 +31,10 @@ public function testPermutations($input, $expected)
3131
{
3232
$generator = new Permutations($input['dataset'], $input['length']);
3333

34-
$this->assertSame($input['dataset'], $generator->getDataset());
35-
$this->assertSame($input['length'], $generator->getLength());
36-
$this->assertSame($expected['count'], $generator->count());
37-
$this->assertEquals(
34+
static::assertSame($input['dataset'], $generator->getDataset());
35+
static::assertSame($input['length'], $generator->getLength());
36+
static::assertSame($expected['count'], $generator->count());
37+
static::assertEquals(
3838
$expected['dataset'],
3939
$generator->toArray(),
4040
'$canonicalize = true',

tests/src/Generators/PrimeFactorsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class PrimeFactorsTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\PrimeFactors
1313
*/
1414
final class PrimeFactorsTest extends AbstractTest
1515
{
@@ -31,8 +31,8 @@ public function testPrimeFactors($input, $expected)
3131
$prime = new PrimeFactors();
3232
$prime->setNumber($input['number']);
3333

34-
$this->assertSame($expected['count'], $prime->count());
35-
$this->assertEquals(
34+
static::assertSame($expected['count'], $prime->count());
35+
static::assertEquals(
3636
$expected['dataset'],
3737
$prime->toArray(),
3838
'$canonicalize = true',

tests/src/Generators/PrimeTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class PrimeTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Prime
1313
*/
1414
final class PrimeTest extends AbstractTest
1515
{
@@ -33,14 +33,14 @@ public function testPrime($input, $expected)
3333
$prime->setMaxLimit($input['max']);
3434

3535
if (2 > $input['min']) {
36-
$this->assertSame(2, $prime->getMinLimit());
36+
static::assertSame(2, $prime->getMinLimit());
3737
} else {
38-
$this->assertSame($input['min'], $prime->getMinLimit());
38+
static::assertSame($input['min'], $prime->getMinLimit());
3939
}
40-
$this->assertSame($input['max'], $prime->getMaxLimit());
40+
static::assertSame($input['max'], $prime->getMaxLimit());
4141

42-
$this->assertSame($expected['count'], $prime->count());
43-
$this->assertEquals(
42+
static::assertSame($expected['count'], $prime->count());
43+
static::assertEquals(
4444
$expected['dataset'],
4545
$prime->toArray(),
4646
'$canonicalize = true',

tests/src/Generators/ProductTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class ProductTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Product
1313
*/
1414
final class ProductTest extends AbstractTest
1515
{
@@ -30,9 +30,9 @@ public function testProduct($input, $expected)
3030
{
3131
$product = new Product($input['dataset']);
3232

33-
$this->assertSame($input['dataset'], $product->getDataset());
34-
$this->assertSame($expected['count'], $product->count());
35-
$this->assertEquals(
33+
static::assertSame($input['dataset'], $product->getDataset());
34+
static::assertSame($expected['count'], $product->count());
35+
static::assertEquals(
3636
$expected['dataset'],
3737
$product->toArray(),
3838
'$canonicalize = true',

tests/src/Generators/ShiftTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class ShiftTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Generators\Shift
1313
*/
1414
final class ShiftTest extends AbstractTest
1515
{
@@ -30,7 +30,7 @@ public function testShift($input, $expected)
3030
{
3131
$shift = new Shift($input['dataset']);
3232

33-
$this->assertSame($input['dataset'], $shift->getDataset());
34-
$this->assertSame($expected['count'], $shift->count());
33+
static::assertSame($input['dataset'], $shift->getDataset());
34+
static::assertSame($expected['count'], $shift->count());
3535
}
3636
}

tests/src/Iterators/CombinationsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Class CombinationsTest.
1010
*
1111
* @internal
12-
* @coversNothing
12+
* @covers \drupol\phpermutations\Iterators\Combinations
1313
*/
1414
final class CombinationsTest extends AbstractTest
1515
{
@@ -30,21 +30,21 @@ public function testCombinations($input, $expected)
3030
{
3131
$combinations = new Combinations($input['dataset'], $input['length']);
3232

33-
$this->assertSame($input['dataset'], $combinations->getDataset());
34-
$this->assertSame($input['length'], $combinations->getLength());
35-
$this->assertCount(
33+
static::assertSame($input['dataset'], $combinations->getDataset());
34+
static::assertSame($input['length'], $combinations->getLength());
35+
static::assertCount(
3636
\count($input['dataset']),
3737
$combinations->getDataset()
3838
);
39-
$this->assertEquals(
39+
static::assertEquals(
4040
$expected['dataset'],
4141
$combinations->toArray(),
4242
'$canonicalize = true',
4343
$delta = 0.0,
4444
$maxDepth = 10,
4545
$canonicalize = true
4646
);
47-
$this->assertSame($expected['count'], $combinations->count());
47+
static::assertSame($expected['count'], $combinations->count());
4848
}
4949

5050
/**
@@ -55,6 +55,6 @@ public function testCombinations($input, $expected)
5555
public function testCombinationsWithBigNumbers()
5656
{
5757
$combinations = new Combinations(\range(1, 200), 2);
58-
$this->assertCount($combinations->count(), $combinations->toArray());
58+
static::assertCount($combinations->count(), $combinations->toArray());
5959
}
6060
}

0 commit comments

Comments
 (0)