Skip to content

Commit 614d974

Browse files
committed
test: refactor classname, variable name to comply PSR-12
1 parent 15e6674 commit 614d974

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

tests/Fake/CI_Email.php renamed to tests/Fake/Email.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Kenjis\PhpUnitHelper;
66

7-
class CI_Email
7+
class Email
88
{
9-
public function to(string $to): CI_Email
9+
public function to(string $to): Email
1010
{
1111
return $this;
1212
}

tests/Fake/CI_Input.php renamed to tests/Fake/Input.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Kenjis\PhpUnitHelper;
66

7-
class CI_Input
7+
class Input
88
{
99
public function method(bool $upper = false): string
1010
{
@@ -16,7 +16,7 @@ public function method(bool $upper = false): string
1616
*
1717
* @return mixed
1818
*/
19-
public function get($index = null, bool $xss_clean = false)
19+
public function get($index = null, bool $xssClean = false)
2020
{
2121
return 'GET value';
2222
}

tests/TestDoubleTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TestDoubleTest extends TestCase
1414
public function test_getDouble_method_named_method(): void
1515
{
1616
$expected = 'DELETE';
17-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
17+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
1818

1919
$actual = $mock->method();
2020

@@ -25,7 +25,7 @@ public function test_getDouble_method_returns_consecutive(): void
2525
{
2626
$returns = ['GET', 'PUT', 'DELETE'];
2727
$mock = $this->getDouble(
28-
CI_Input::class,
28+
Input::class,
2929
[
3030
['method' => $returns],
3131
]
@@ -45,7 +45,7 @@ public function test_getDouble_returns_consecutive_and_other(): void
4545
{
4646
$returns = ['GET', 'PUT', 'DELETE'];
4747
$mock = $this->getDouble(
48-
CI_Input::class,
48+
Input::class,
4949
[
5050
'get' => [],
5151
['method' => $returns],
@@ -76,7 +76,7 @@ public function test_getDouble_method_returns_execption(): void
7676
$ret = static function ($param1, $param2): void {
7777
throw new RuntimeException('I can throw an exception and can use params: ' . $param1 . $param2);
7878
};
79-
$mock = $this->getDouble(CI_Input::class, ['method' => $ret]);
79+
$mock = $this->getDouble(Input::class, ['method' => $ret]);
8080

8181
$mock->method();
8282
}
@@ -97,7 +97,7 @@ public function test_getDouble_constructor_param(): void
9797

9898
public function test_getDobule_method_returns_phpunit_stub(): void
9999
{
100-
$mock = $this->getDouble(CI_Email::class, ['to' => $this->returnSelf()]);
100+
$mock = $this->getDouble(Email::class, ['to' => $this->returnSelf()]);
101101
$test = $mock->to('test@example.com');
102102

103103
$this->assertEquals($mock, $test);
@@ -106,7 +106,7 @@ public function test_getDobule_method_returns_phpunit_stub(): void
106106
public function test_verifyInvokedOnce_with_params(): void
107107
{
108108
$expected = 'DELETE';
109-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
109+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
110110

111111
$this->verifyInvokedOnce($mock, 'method', [true]);
112112

@@ -116,7 +116,7 @@ public function test_verifyInvokedOnce_with_params(): void
116116
public function test_verifyInvokedOnce_without_params(): void
117117
{
118118
$expected = 'DELETE';
119-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
119+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
120120

121121
$this->verifyInvokedOnce($mock, 'method');
122122

@@ -126,7 +126,7 @@ public function test_verifyInvokedOnce_without_params(): void
126126
public function test_verifyInvoked_once(): void
127127
{
128128
$expected = 'DELETE';
129-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
129+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
130130

131131
$this->verifyInvoked($mock, 'method');
132132

@@ -136,7 +136,7 @@ public function test_verifyInvoked_once(): void
136136
public function test_verifyInvoked_twice(): void
137137
{
138138
$expected = 'DELETE';
139-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
139+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
140140

141141
$this->verifyInvoked($mock, 'method');
142142

@@ -147,7 +147,7 @@ public function test_verifyInvoked_twice(): void
147147
public function test_verifyInvokedMultipleTimes(): void
148148
{
149149
$expected = 'DELETE';
150-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
150+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
151151

152152
$this->verifyInvokedMultipleTimes($mock, 'method', 3);
153153

@@ -159,7 +159,7 @@ public function test_verifyInvokedMultipleTimes(): void
159159
public function test_verifyNeverInvoked(): void
160160
{
161161
$expected = 'DELETE';
162-
$mock = $this->getDouble(CI_Input::class, ['method' => $expected]);
162+
$mock = $this->getDouble(Input::class, ['method' => $expected]);
163163

164164
$this->verifyNeverInvoked($mock, 'method');
165165
}

0 commit comments

Comments
 (0)