@@ -26,7 +26,7 @@ |
||
26 | 26 | $I = $this->tester; |
27 | 27 | $I->describe('income tax calculations'); |
28 | 28 | |
29 | - $I->verifyThat('income calculator honors tax rules for different ranges of income', function (TestGuy $I) use ($service) { |
|
29 | + $I->verifyThat('income calculator honors tax rules for different ranges of income', function(TestGuy $I) use ($service) { |
|
30 | 30 | $I->lookAt('income tax'); |
31 | 31 | |
32 | 32 | $I->expectThat('for income less that 50 000 calculator use 10% tax rule'); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | public function toString() { |
36 | 36 | $stepResult = $this->isChecked() ? "\u{2713} " : '- '; |
37 | - return $stepResult . $this->name; |
|
37 | + return $stepResult.$this->name; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | protected function isChecked() { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @return $this |
47 | 47 | */ |
48 | 48 | public function describe(string $scenario): TestGuy { |
49 | - $this->steps->add('I describe ' . $scenario); |
|
49 | + $this->steps->add('I describe '.$scenario); |
|
50 | 50 | return $this; |
51 | 51 | } |
52 | 52 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @return $this |
61 | 61 | */ |
62 | 62 | public function expectThat(string $expectation): TestGuy { |
63 | - $this->steps->add('I expect that ' . $expectation); |
|
63 | + $this->steps->add('I expect that '.$expectation); |
|
64 | 64 | |
65 | 65 | return $this; |
66 | 66 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return $this |
79 | 79 | */ |
80 | 80 | public function verifyThat(string $expectation, callable $verificationSteps = null): TestGuy { |
81 | - $this->steps->add('I verify that ' . $expectation); |
|
81 | + $this->steps->add('I verify that '.$expectation); |
|
82 | 82 | if ($verificationSteps) { |
83 | 83 | $verificationSteps($this); |
84 | 84 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * @return $this |
37 | 37 | */ |
38 | 38 | public function expectTo(string $expectation): TestGuy { |
39 | - $this->steps->add('I expect to ' . $expectation); |
|
39 | + $this->steps->add('I expect to '.$expectation); |
|
40 | 40 | return $this; |
41 | 41 | } |
42 | 42 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public function isReadable() { |
22 | 22 | $this->isExist(); |
23 | 23 | $this->startStep('is readable') |
24 | - ->assertIsReadable(); |
|
24 | + ->assertIsReadable(); |
|
25 | 25 | |
26 | 26 | return $this; |
27 | 27 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function isNotReadable() { |
33 | 33 | $this->isExist(); |
34 | 34 | $this->startStep('is not readable') |
35 | - ->assertNotIsReadable(); |
|
35 | + ->assertNotIsReadable(); |
|
36 | 36 | |
37 | 37 | return $this; |
38 | 38 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function isWritable() { |
44 | 44 | $this->isExist(); |
45 | 45 | $this->startStep('is writable') |
46 | - ->assertIsWritable(); |
|
46 | + ->assertIsWritable(); |
|
47 | 47 | |
48 | 48 | return $this; |
49 | 49 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function isNotWritable() { |
55 | 55 | $this->isExist(); |
56 | 56 | $this->startStep('is not writable') |
57 | - ->assertNotIsWritable(); |
|
57 | + ->assertNotIsWritable(); |
|
58 | 58 | |
59 | 59 | return $this; |
60 | 60 | } |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | public $exceptionClassOrObject; |
19 | 19 | public function withMessage($message) { |
20 | 20 | $this->startStep('has message "' . $message . '"') |
21 | - ->expectExceptionMessage($message); |
|
21 | + ->expectExceptionMessage($message); |
|
22 | 22 | |
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | 26 | public function withMessageMatchesPattern($messagePattern) { |
27 | 27 | $this->startStep('has message matching pattern "' . $messagePattern . '"') |
28 | - ->expectExceptionMessageRegExp($messagePattern); |
|
28 | + ->expectExceptionMessageRegExp($messagePattern); |
|
29 | 29 | |
30 | 30 | return $this; |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function withCode($code) { |
34 | 34 | $this->startStep('has code "' . $code . '"') |
35 | - ->expectExceptionCode($code); |
|
35 | + ->expectExceptionCode($code); |
|
36 | 36 | |
37 | 37 | return $this; |
38 | 38 | } |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | $exceptionClassOrObject = $this->exceptionClassOrObject; |
53 | 53 | if (is_string($exceptionClassOrObject)) { |
54 | 54 | $this->startStep('throws exception "' . $exceptionClassOrObject . '"') |
55 | - ->expectException($this->exceptionClassOrObject); |
|
55 | + ->expectException($this->exceptionClassOrObject); |
|
56 | 56 | } else { |
57 | 57 | $this->startStep('throws exception "' . get_class($exceptionClassOrObject) . '"') |
58 | - ->expectExceptionObject($this->exceptionClassOrObject); |
|
58 | + ->expectExceptionObject($this->exceptionClassOrObject); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | call_user_func_array($callback, [$this->getActualValue()]); |
@@ -17,21 +17,21 @@ discard block |
||
17 | 17 | class ObjectExceptionMatcher extends Matcher { |
18 | 18 | public $exceptionClassOrObject; |
19 | 19 | public function withMessage($message) { |
20 | - $this->startStep('has message "' . $message . '"') |
|
20 | + $this->startStep('has message "'.$message.'"') |
|
21 | 21 | ->expectExceptionMessage($message); |
22 | 22 | |
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | 26 | public function withMessageMatchesPattern($messagePattern) { |
27 | - $this->startStep('has message matching pattern "' . $messagePattern . '"') |
|
27 | + $this->startStep('has message matching pattern "'.$messagePattern.'"') |
|
28 | 28 | ->expectExceptionMessageRegExp($messagePattern); |
29 | 29 | |
30 | 30 | return $this; |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function withCode($code) { |
34 | - $this->startStep('has code "' . $code . '"') |
|
34 | + $this->startStep('has code "'.$code.'"') |
|
35 | 35 | ->expectExceptionCode($code); |
36 | 36 | |
37 | 37 | return $this; |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | public function when(callable $callback) { |
52 | 52 | $exceptionClassOrObject = $this->exceptionClassOrObject; |
53 | 53 | if (is_string($exceptionClassOrObject)) { |
54 | - $this->startStep('throws exception "' . $exceptionClassOrObject . '"') |
|
54 | + $this->startStep('throws exception "'.$exceptionClassOrObject.'"') |
|
55 | 55 | ->expectException($this->exceptionClassOrObject); |
56 | 56 | } else { |
57 | - $this->startStep('throws exception "' . get_class($exceptionClassOrObject) . '"') |
|
57 | + $this->startStep('throws exception "'.get_class($exceptionClassOrObject).'"') |
|
58 | 58 | ->expectExceptionObject($this->exceptionClassOrObject); |
59 | 59 | } |
60 | 60 |
@@ -33,9 +33,9 @@ |
||
33 | 33 | |
34 | 34 | public function convertToString(): string { |
35 | 35 | $message = implode(PHP_EOL, $this->steps); |
36 | - $message = $message ? $message . PHP_EOL : $message; |
|
36 | + $message = $message ? $message.PHP_EOL : $message; |
|
37 | 37 | |
38 | - return (string)$message; |
|
38 | + return (string) $message; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function clear() { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function isInstanceOf($class): self { |
19 | 19 | $this->startStep('is instance of "' . $class . '"') |
20 | - ->assertInstanceOf($class); |
|
20 | + ->assertInstanceOf($class); |
|
21 | 21 | |
22 | 22 | return $this; |
23 | 23 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function isNotInstanceOf($class): self { |
29 | 29 | $this->startStep('is not instance of "' . $class . '"') |
30 | - ->assertNotInstanceOf($class); |
|
30 | + ->assertNotInstanceOf($class); |
|
31 | 31 | |
32 | 32 | return $this; |
33 | 33 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function isEqualToXmlStructure($expectedElement): self { |
42 | 42 | $this->isInstanceOf(DOMElement::class); |
43 | 43 | $this->startStep('is equal to expected DOMElement') |
44 | - ->assertEqualXMLStructure($expectedElement, false); |
|
44 | + ->assertEqualXMLStructure($expectedElement, false); |
|
45 | 45 | |
46 | 46 | return $this; |
47 | 47 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function isEqualToXmlStructureAndItsAttributes($expectedElement): self { |
60 | 60 | $this->isInstanceOf(DOMElement::class); |
61 | 61 | $this->startStep('is equal to xml structure and it\'s attributes in DOMElement') |
62 | - ->assertEqualXMLStructure($expectedElement, true); |
|
62 | + ->assertEqualXMLStructure($expectedElement, true); |
|
63 | 63 | |
64 | 64 | return $this; |
65 | 65 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function hasAttribute($attribute): self { |
71 | 71 | $this->startStep('has attribute "' . $attribute . '"') |
72 | - ->assertObjectHasAttribute($attribute); |
|
72 | + ->assertObjectHasAttribute($attribute); |
|
73 | 73 | |
74 | 74 | return $this; |
75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function doesNotHaveAttribute($attribute): self { |
81 | 81 | $this->startStep('does not have attribute "' . $attribute . '"') |
82 | - ->assertObjectNotHasAttribute($attribute); |
|
82 | + ->assertObjectNotHasAttribute($attribute); |
|
83 | 83 | |
84 | 84 | return $this; |
85 | 85 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @return $this |
17 | 17 | */ |
18 | 18 | public function isInstanceOf($class): self { |
19 | - $this->startStep('is instance of "' . $class . '"') |
|
19 | + $this->startStep('is instance of "'.$class.'"') |
|
20 | 20 | ->assertInstanceOf($class); |
21 | 21 | |
22 | 22 | return $this; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @return $this |
27 | 27 | */ |
28 | 28 | public function isNotInstanceOf($class): self { |
29 | - $this->startStep('is not instance of "' . $class . '"') |
|
29 | + $this->startStep('is not instance of "'.$class.'"') |
|
30 | 30 | ->assertNotInstanceOf($class); |
31 | 31 | |
32 | 32 | return $this; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return $this |
69 | 69 | */ |
70 | 70 | public function hasAttribute($attribute): self { |
71 | - $this->startStep('has attribute "' . $attribute . '"') |
|
71 | + $this->startStep('has attribute "'.$attribute.'"') |
|
72 | 72 | ->assertObjectHasAttribute($attribute); |
73 | 73 | |
74 | 74 | return $this; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return $this |
79 | 79 | */ |
80 | 80 | public function doesNotHaveAttribute($attribute): self { |
81 | - $this->startStep('does not have attribute "' . $attribute . '"') |
|
81 | + $this->startStep('does not have attribute "'.$attribute.'"') |
|
82 | 82 | ->assertObjectNotHasAttribute($attribute); |
83 | 83 | |
84 | 84 | return $this; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function throwsException($exceptionClassOrObject): ObjectExceptionMatcher { |
95 | 95 | $class = is_string($exceptionClassOrObject) ? $exceptionClassOrObject : get_class($exceptionClassOrObject); |
96 | - $matcher = $this->createInternalMatcherWithDescription(ObjectExceptionMatcher::class, 'I see that exception "' . $class . '"'); |
|
96 | + $matcher = $this->createInternalMatcherWithDescription(ObjectExceptionMatcher::class, 'I see that exception "'.$class.'"'); |
|
97 | 97 | |
98 | 98 | $matcher->exceptionClassOrObject = $exceptionClassOrObject; |
99 | 99 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function isExist(): self { |
21 | 21 | $this->startStep('is exist') |
22 | - ->assertFileExists(); |
|
22 | + ->assertFileExists(); |
|
23 | 23 | |
24 | 24 | return $this; |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function isNotExist(): self { |
31 | 31 | $this->startStep('is not exist') |
32 | - ->assertFileNotExists(); |
|
32 | + ->assertFileNotExists(); |
|
33 | 33 | |
34 | 34 | return $this; |
35 | 35 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function isEqualTo($file): self { |
41 | 41 | $this->startStep('is equal to file "' . $file . '"') |
42 | - ->assertFileEquals($file); |
|
42 | + ->assertFileEquals($file); |
|
43 | 43 | |
44 | 44 | return $this; |
45 | 45 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function isNotEqualTo($file): self { |
51 | 51 | $this->startStep('is not equal to file "' . $file . '"') |
52 | - ->assertFileNotEquals($file); |
|
52 | + ->assertFileNotEquals($file); |
|
53 | 53 | |
54 | 54 | return $this; |
55 | 55 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function isEqualToJsonFile($file): self { |
61 | 61 | $this->startStep('is equal to json file "' . $file . '"') |
62 | - ->assertJsonFileEqualsJsonFile($file); |
|
62 | + ->assertJsonFileEqualsJsonFile($file); |
|
63 | 63 | |
64 | 64 | return $this; |
65 | 65 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function isNotEqualToJsonFile($file): self { |
71 | 71 | $this->startStep('is not equal to json file "' . $file . '"') |
72 | - ->assertJsonFileNotEqualsJsonFile($file); |
|
72 | + ->assertJsonFileNotEqualsJsonFile($file); |
|
73 | 73 | |
74 | 74 | return $this; |
75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function isEqualToXmlFile($file): self { |
81 | 81 | $this->startStep('is equal to xml file "' . $file . '"') |
82 | - ->assertXmlFileEqualsXmlFile($file); |
|
82 | + ->assertXmlFileEqualsXmlFile($file); |
|
83 | 83 | |
84 | 84 | return $this; |
85 | 85 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function isNotEqualToXmlFile($file): self { |
91 | 91 | $this->startStep('is not equal to xml file "' . $file . '"') |
92 | - ->assertXmlFileNotEqualsXmlFile($file); |
|
92 | + ->assertXmlFileNotEqualsXmlFile($file); |
|
93 | 93 | |
94 | 94 | return $this; |
95 | 95 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return $this |
39 | 39 | */ |
40 | 40 | public function isEqualTo($file): self { |
41 | - $this->startStep('is equal to file "' . $file . '"') |
|
41 | + $this->startStep('is equal to file "'.$file.'"') |
|
42 | 42 | ->assertFileEquals($file); |
43 | 43 | |
44 | 44 | return $this; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @return $this |
49 | 49 | */ |
50 | 50 | public function isNotEqualTo($file): self { |
51 | - $this->startStep('is not equal to file "' . $file . '"') |
|
51 | + $this->startStep('is not equal to file "'.$file.'"') |
|
52 | 52 | ->assertFileNotEquals($file); |
53 | 53 | |
54 | 54 | return $this; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return $this |
59 | 59 | */ |
60 | 60 | public function isEqualToJsonFile($file): self { |
61 | - $this->startStep('is equal to json file "' . $file . '"') |
|
61 | + $this->startStep('is equal to json file "'.$file.'"') |
|
62 | 62 | ->assertJsonFileEqualsJsonFile($file); |
63 | 63 | |
64 | 64 | return $this; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return $this |
69 | 69 | */ |
70 | 70 | public function isNotEqualToJsonFile($file): self { |
71 | - $this->startStep('is not equal to json file "' . $file . '"') |
|
71 | + $this->startStep('is not equal to json file "'.$file.'"') |
|
72 | 72 | ->assertJsonFileNotEqualsJsonFile($file); |
73 | 73 | |
74 | 74 | return $this; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return $this |
79 | 79 | */ |
80 | 80 | public function isEqualToXmlFile($file): self { |
81 | - $this->startStep('is equal to xml file "' . $file . '"') |
|
81 | + $this->startStep('is equal to xml file "'.$file.'"') |
|
82 | 82 | ->assertXmlFileEqualsXmlFile($file); |
83 | 83 | |
84 | 84 | return $this; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return $this |
89 | 89 | */ |
90 | 90 | public function isNotEqualToXmlFile($file): self { |
91 | - $this->startStep('is not equal to xml file "' . $file . '"') |
|
91 | + $this->startStep('is not equal to xml file "'.$file.'"') |
|
92 | 92 | ->assertXmlFileNotEqualsXmlFile($file); |
93 | 93 | |
94 | 94 | return $this; |