@@ -3,12 +3,12 @@ |
||
3 | 3 | |
4 | 4 | class NamespaceCoveragePrivateTest extends TestCase |
5 | 5 | { |
6 | - /** |
|
7 | - * @covers Foo\CoveredClass::<private> |
|
8 | - */ |
|
9 | - public function testSomething() |
|
10 | - { |
|
11 | - $o = new Foo\CoveredClass; |
|
12 | - $o->publicMethod(); |
|
13 | - } |
|
6 | + /** |
|
7 | + * @covers Foo\CoveredClass::<private> |
|
8 | + */ |
|
9 | + public function testSomething() |
|
10 | + { |
|
11 | + $o = new Foo\CoveredClass; |
|
12 | + $o->publicMethod(); |
|
13 | + } |
|
14 | 14 | } |
@@ -12,45 +12,45 @@ |
||
12 | 12 | |
13 | 13 | class BankAccountTest extends TestCase |
14 | 14 | { |
15 | - private $ba; |
|
15 | + private $ba; |
|
16 | 16 | |
17 | - protected function setUp() |
|
18 | - { |
|
19 | - $this->ba = new BankAccount; |
|
20 | - } |
|
17 | + protected function setUp() |
|
18 | + { |
|
19 | + $this->ba = new BankAccount; |
|
20 | + } |
|
21 | 21 | |
22 | - public function testBalanceIsInitiallyZero() |
|
23 | - { |
|
24 | - $ba = new BankAccount; |
|
22 | + public function testBalanceIsInitiallyZero() |
|
23 | + { |
|
24 | + $ba = new BankAccount; |
|
25 | 25 | |
26 | - $balance = $ba->getBalance(); |
|
26 | + $balance = $ba->getBalance(); |
|
27 | 27 | |
28 | - $this->assertEquals(0, $balance); |
|
29 | - } |
|
28 | + $this->assertEquals(0, $balance); |
|
29 | + } |
|
30 | 30 | |
31 | - public function testBalanceCannotBecomeNegative() |
|
32 | - { |
|
33 | - try { |
|
34 | - $this->ba->withdrawMoney(1); |
|
35 | - } catch (BankAccountException $e) { |
|
36 | - $this->assertEquals(0, $this->ba->getBalance()); |
|
31 | + public function testBalanceCannotBecomeNegative() |
|
32 | + { |
|
33 | + try { |
|
34 | + $this->ba->withdrawMoney(1); |
|
35 | + } catch (BankAccountException $e) { |
|
36 | + $this->assertEquals(0, $this->ba->getBalance()); |
|
37 | 37 | |
38 | - return; |
|
39 | - } |
|
38 | + return; |
|
39 | + } |
|
40 | 40 | |
41 | - $this->fail(); |
|
42 | - } |
|
41 | + $this->fail(); |
|
42 | + } |
|
43 | 43 | |
44 | - public function testBalanceCannotBecomeNegative2() |
|
45 | - { |
|
46 | - try { |
|
47 | - $this->ba->depositMoney(-1); |
|
48 | - } catch (BankAccountException $e) { |
|
49 | - $this->assertEquals(0, $this->ba->getBalance()); |
|
44 | + public function testBalanceCannotBecomeNegative2() |
|
45 | + { |
|
46 | + try { |
|
47 | + $this->ba->depositMoney(-1); |
|
48 | + } catch (BankAccountException $e) { |
|
49 | + $this->assertEquals(0, $this->ba->getBalance()); |
|
50 | 50 | |
51 | - return; |
|
52 | - } |
|
51 | + return; |
|
52 | + } |
|
53 | 53 | |
54 | - $this->fail(); |
|
55 | - } |
|
54 | + $this->fail(); |
|
55 | + } |
|
56 | 56 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class OneTest extends TestCase |
6 | 6 | { |
7 | - use TestCaseTrait; |
|
7 | + use TestCaseTrait; |
|
8 | 8 | |
9 | - public function testOne() |
|
10 | - { |
|
11 | - $this->assertExampleExtensionInitialized(); |
|
12 | - } |
|
9 | + public function testOne() |
|
10 | + { |
|
11 | + $this->assertExampleExtensionInitialized(); |
|
12 | + } |
|
13 | 13 | } |
@@ -3,75 +3,75 @@ |
||
3 | 3 | |
4 | 4 | class FailureTest extends TestCase |
5 | 5 | { |
6 | - public function testAssertArrayEqualsArray() |
|
7 | - { |
|
8 | - $this->assertEquals([1], [2], 'message'); |
|
9 | - } |
|
6 | + public function testAssertArrayEqualsArray() |
|
7 | + { |
|
8 | + $this->assertEquals([1], [2], 'message'); |
|
9 | + } |
|
10 | 10 | |
11 | - public function testAssertIntegerEqualsInteger() |
|
12 | - { |
|
13 | - $this->assertEquals(1, 2, 'message'); |
|
14 | - } |
|
11 | + public function testAssertIntegerEqualsInteger() |
|
12 | + { |
|
13 | + $this->assertEquals(1, 2, 'message'); |
|
14 | + } |
|
15 | 15 | |
16 | - public function testAssertObjectEqualsObject() |
|
17 | - { |
|
18 | - $a = new stdClass; |
|
19 | - $a->foo = 'bar'; |
|
16 | + public function testAssertObjectEqualsObject() |
|
17 | + { |
|
18 | + $a = new stdClass; |
|
19 | + $a->foo = 'bar'; |
|
20 | 20 | |
21 | - $b = new stdClass; |
|
22 | - $b->bar = 'foo'; |
|
21 | + $b = new stdClass; |
|
22 | + $b->bar = 'foo'; |
|
23 | 23 | |
24 | - $this->assertEquals($a, $b, 'message'); |
|
25 | - } |
|
24 | + $this->assertEquals($a, $b, 'message'); |
|
25 | + } |
|
26 | 26 | |
27 | - public function testAssertNullEqualsString() |
|
28 | - { |
|
29 | - $this->assertEquals(null, 'bar', 'message'); |
|
30 | - } |
|
27 | + public function testAssertNullEqualsString() |
|
28 | + { |
|
29 | + $this->assertEquals(null, 'bar', 'message'); |
|
30 | + } |
|
31 | 31 | |
32 | - public function testAssertStringEqualsString() |
|
33 | - { |
|
34 | - $this->assertEquals('foo', 'bar', 'message'); |
|
35 | - } |
|
32 | + public function testAssertStringEqualsString() |
|
33 | + { |
|
34 | + $this->assertEquals('foo', 'bar', 'message'); |
|
35 | + } |
|
36 | 36 | |
37 | - public function testAssertTextEqualsText() |
|
38 | - { |
|
39 | - $this->assertEquals("foo\nbar\n", "foo\nbaz\n", 'message'); |
|
40 | - } |
|
37 | + public function testAssertTextEqualsText() |
|
38 | + { |
|
39 | + $this->assertEquals("foo\nbar\n", "foo\nbaz\n", 'message'); |
|
40 | + } |
|
41 | 41 | |
42 | - public function testAssertStringMatchesFormat() |
|
43 | - { |
|
44 | - $this->assertStringMatchesFormat('*%s*', '**', 'message'); |
|
45 | - } |
|
42 | + public function testAssertStringMatchesFormat() |
|
43 | + { |
|
44 | + $this->assertStringMatchesFormat('*%s*', '**', 'message'); |
|
45 | + } |
|
46 | 46 | |
47 | - public function testAssertNumericEqualsNumeric() |
|
48 | - { |
|
49 | - $this->assertEquals(1, 2, 'message'); |
|
50 | - } |
|
47 | + public function testAssertNumericEqualsNumeric() |
|
48 | + { |
|
49 | + $this->assertEquals(1, 2, 'message'); |
|
50 | + } |
|
51 | 51 | |
52 | - public function testAssertTextSameText() |
|
53 | - { |
|
54 | - $this->assertSame('foo', 'bar', 'message'); |
|
55 | - } |
|
52 | + public function testAssertTextSameText() |
|
53 | + { |
|
54 | + $this->assertSame('foo', 'bar', 'message'); |
|
55 | + } |
|
56 | 56 | |
57 | - public function testAssertObjectSameObject() |
|
58 | - { |
|
59 | - $this->assertSame(new stdClass, new stdClass, 'message'); |
|
60 | - } |
|
57 | + public function testAssertObjectSameObject() |
|
58 | + { |
|
59 | + $this->assertSame(new stdClass, new stdClass, 'message'); |
|
60 | + } |
|
61 | 61 | |
62 | - public function testAssertObjectSameNull() |
|
63 | - { |
|
64 | - $this->assertSame(new stdClass, null, 'message'); |
|
65 | - } |
|
62 | + public function testAssertObjectSameNull() |
|
63 | + { |
|
64 | + $this->assertSame(new stdClass, null, 'message'); |
|
65 | + } |
|
66 | 66 | |
67 | - public function testAssertFloatSameFloat() |
|
68 | - { |
|
69 | - $this->assertSame(1.0, 1.5, 'message'); |
|
70 | - } |
|
67 | + public function testAssertFloatSameFloat() |
|
68 | + { |
|
69 | + $this->assertSame(1.0, 1.5, 'message'); |
|
70 | + } |
|
71 | 71 | |
72 | - // Note that due to the implementation of this assertion it counts as 2 asserts |
|
73 | - public function testAssertStringMatchesFormatFile() |
|
74 | - { |
|
75 | - $this->assertStringMatchesFormatFile(__DIR__ . '/expectedFileFormat.txt', '...BAR...'); |
|
76 | - } |
|
72 | + // Note that due to the implementation of this assertion it counts as 2 asserts |
|
73 | + public function testAssertStringMatchesFormatFile() |
|
74 | + { |
|
75 | + $this->assertStringMatchesFormatFile(__DIR__ . '/expectedFileFormat.txt', '...BAR...'); |
|
76 | + } |
|
77 | 77 | } |
@@ -72,6 +72,6 @@ |
||
72 | 72 | // Note that due to the implementation of this assertion it counts as 2 asserts |
73 | 73 | public function testAssertStringMatchesFormatFile() |
74 | 74 | { |
75 | - $this->assertStringMatchesFormatFile(__DIR__ . '/expectedFileFormat.txt', '...BAR...'); |
|
75 | + $this->assertStringMatchesFormatFile(__DIR__.'/expectedFileFormat.txt', '...BAR...'); |
|
76 | 76 | } |
77 | 77 | } |
@@ -3,14 +3,14 @@ |
||
3 | 3 | |
4 | 4 | class MyCommand extends Command |
5 | 5 | { |
6 | - public function __construct() |
|
7 | - { |
|
8 | - $this->longOptions['my-option='] = 'myHandler'; |
|
9 | - $this->longOptions['my-other-option'] = null; |
|
10 | - } |
|
6 | + public function __construct() |
|
7 | + { |
|
8 | + $this->longOptions['my-option='] = 'myHandler'; |
|
9 | + $this->longOptions['my-other-option'] = null; |
|
10 | + } |
|
11 | 11 | |
12 | - public function myHandler($value) |
|
13 | - { |
|
14 | - echo __METHOD__ . " $value\n"; |
|
15 | - } |
|
12 | + public function myHandler($value) |
|
13 | + { |
|
14 | + echo __METHOD__ . " $value\n"; |
|
15 | + } |
|
16 | 16 | } |
@@ -11,6 +11,6 @@ |
||
11 | 11 | |
12 | 12 | public function myHandler($value) |
13 | 13 | { |
14 | - echo __METHOD__ . " $value\n"; |
|
14 | + echo __METHOD__." $value\n"; |
|
15 | 15 | } |
16 | 16 | } |
@@ -2,39 +2,39 @@ |
||
2 | 2 | |
3 | 3 | class ArrayAccessible implements ArrayAccess, IteratorAggregate |
4 | 4 | { |
5 | - private $array; |
|
5 | + private $array; |
|
6 | 6 | |
7 | - public function __construct(array $array = []) |
|
8 | - { |
|
9 | - $this->array = $array; |
|
10 | - } |
|
7 | + public function __construct(array $array = []) |
|
8 | + { |
|
9 | + $this->array = $array; |
|
10 | + } |
|
11 | 11 | |
12 | - public function offsetExists($offset) |
|
13 | - { |
|
14 | - return array_key_exists($offset, $this->array); |
|
15 | - } |
|
12 | + public function offsetExists($offset) |
|
13 | + { |
|
14 | + return array_key_exists($offset, $this->array); |
|
15 | + } |
|
16 | 16 | |
17 | - public function offsetGet($offset) |
|
18 | - { |
|
19 | - return $this->array[$offset]; |
|
20 | - } |
|
17 | + public function offsetGet($offset) |
|
18 | + { |
|
19 | + return $this->array[$offset]; |
|
20 | + } |
|
21 | 21 | |
22 | - public function offsetSet($offset, $value) |
|
23 | - { |
|
24 | - if (null === $offset) { |
|
25 | - $this->array[] = $value; |
|
26 | - } else { |
|
27 | - $this->array[$offset] = $value; |
|
28 | - } |
|
29 | - } |
|
22 | + public function offsetSet($offset, $value) |
|
23 | + { |
|
24 | + if (null === $offset) { |
|
25 | + $this->array[] = $value; |
|
26 | + } else { |
|
27 | + $this->array[$offset] = $value; |
|
28 | + } |
|
29 | + } |
|
30 | 30 | |
31 | - public function offsetUnset($offset) |
|
32 | - { |
|
33 | - unset($this->array[$offset]); |
|
34 | - } |
|
31 | + public function offsetUnset($offset) |
|
32 | + { |
|
33 | + unset($this->array[$offset]); |
|
34 | + } |
|
35 | 35 | |
36 | - public function getIterator() |
|
37 | - { |
|
38 | - return new ArrayIterator($this->array); |
|
39 | - } |
|
36 | + public function getIterator() |
|
37 | + { |
|
38 | + return new ArrayIterator($this->array); |
|
39 | + } |
|
40 | 40 | } |
@@ -3,12 +3,12 @@ |
||
3 | 3 | |
4 | 4 | class CoverageClassExtendedTest extends TestCase |
5 | 5 | { |
6 | - /** |
|
7 | - * @covers CoveredClass<extended> |
|
8 | - */ |
|
9 | - public function testSomething() |
|
10 | - { |
|
11 | - $o = new CoveredClass; |
|
12 | - $o->publicMethod(); |
|
13 | - } |
|
6 | + /** |
|
7 | + * @covers CoveredClass<extended> |
|
8 | + */ |
|
9 | + public function testSomething() |
|
10 | + { |
|
11 | + $o = new CoveredClass; |
|
12 | + $o->publicMethod(); |
|
13 | + } |
|
14 | 14 | } |
@@ -3,12 +3,12 @@ |
||
3 | 3 | |
4 | 4 | class CoverageClassTest extends TestCase |
5 | 5 | { |
6 | - /** |
|
7 | - * @covers CoveredClass |
|
8 | - */ |
|
9 | - public function testSomething() |
|
10 | - { |
|
11 | - $o = new CoveredClass; |
|
12 | - $o->publicMethod(); |
|
13 | - } |
|
6 | + /** |
|
7 | + * @covers CoveredClass |
|
8 | + */ |
|
9 | + public function testSomething() |
|
10 | + { |
|
11 | + $o = new CoveredClass; |
|
12 | + $o->publicMethod(); |
|
13 | + } |
|
14 | 14 | } |
@@ -3,39 +3,39 @@ |
||
3 | 3 | |
4 | 4 | class DataProviderFilterTest extends TestCase |
5 | 5 | { |
6 | - /** |
|
7 | - * @dataProvider truthProvider |
|
8 | - */ |
|
9 | - public function testTrue($truth) |
|
10 | - { |
|
11 | - $this->assertTrue($truth); |
|
12 | - } |
|
6 | + /** |
|
7 | + * @dataProvider truthProvider |
|
8 | + */ |
|
9 | + public function testTrue($truth) |
|
10 | + { |
|
11 | + $this->assertTrue($truth); |
|
12 | + } |
|
13 | 13 | |
14 | - public static function truthProvider() |
|
15 | - { |
|
16 | - return [ |
|
17 | - [true], |
|
18 | - [true], |
|
19 | - [true], |
|
20 | - [true] |
|
21 | - ]; |
|
22 | - } |
|
14 | + public static function truthProvider() |
|
15 | + { |
|
16 | + return [ |
|
17 | + [true], |
|
18 | + [true], |
|
19 | + [true], |
|
20 | + [true] |
|
21 | + ]; |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * @dataProvider falseProvider |
|
26 | - */ |
|
27 | - public function testFalse($false) |
|
28 | - { |
|
29 | - $this->assertFalse($false); |
|
30 | - } |
|
24 | + /** |
|
25 | + * @dataProvider falseProvider |
|
26 | + */ |
|
27 | + public function testFalse($false) |
|
28 | + { |
|
29 | + $this->assertFalse($false); |
|
30 | + } |
|
31 | 31 | |
32 | - public static function falseProvider() |
|
33 | - { |
|
34 | - return [ |
|
35 | - 'false test' => [false], |
|
36 | - 'false test 2' => [false], |
|
37 | - 'other false test' => [false], |
|
38 | - 'other false test2'=> [false] |
|
39 | - ]; |
|
40 | - } |
|
32 | + public static function falseProvider() |
|
33 | + { |
|
34 | + return [ |
|
35 | + 'false test' => [false], |
|
36 | + 'false test 2' => [false], |
|
37 | + 'other false test' => [false], |
|
38 | + 'other false test2'=> [false] |
|
39 | + ]; |
|
40 | + } |
|
41 | 41 | } |