Skip to content

Commit d02137d

Browse files
committed
Fix #5: Setting expected values does not work properly
1 parent d00512b commit d02137d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/TestCase/TestSetterAndGetterTrait.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function testSetterAndGetter($name, $spec = null): void
154154
[$setter, $setterArgs] = $spec['setter'];
155155
$setterValue = $target->$setter($value, ...$setterArgs);
156156

157-
if ('__SETTER_AND_GETTER__' != $spec['setter_value']) {
157+
if ($spec['setter_value'] !== '__SETTER_AND_GETTER__') {
158158
$spec['setter_assert']($spec['setter_value'], $setterValue);
159159
}
160160
}
@@ -163,7 +163,7 @@ public function testSetterAndGetter($name, $spec = null): void
163163
[$getter, $getterArgs] = $spec['getter'];
164164
$getterValue = $target->$getter(...$getterArgs);
165165

166-
if ($spec['expect'] != '__SETTER_AND_GETTER__') {
166+
if ($spec['expect'] !== '__SETTER_AND_GETTER__') {
167167
$value = $spec['expect'];
168168
}
169169

@@ -210,7 +210,7 @@ private function setterAndGetterNormalizeSpec($spec, string $name, object $targe
210210
break;
211211

212212
case 'setter_value':
213-
if ('__SELF__' == $value) {
213+
if ('__SELF__' === $value) {
214214
$value = $target;
215215
if (!isset($spec['setter_assert'])) {
216216
$normalized['setter_assert'] = [static::class, 'assertSame'];

0 commit comments

Comments
 (0)