Skip to content

Commit

Permalink
Fix #5: Setting expected values does not work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
TiSiE committed Feb 19, 2020
1 parent d00512b commit d02137d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TestCase/TestSetterAndGetterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testSetterAndGetter($name, $spec = null): void
[$setter, $setterArgs] = $spec['setter'];
$setterValue = $target->$setter($value, ...$setterArgs);

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

if ($spec['expect'] != '__SETTER_AND_GETTER__') {
if ($spec['expect'] !== '__SETTER_AND_GETTER__') {
$value = $spec['expect'];
}

Expand Down Expand Up @@ -210,7 +210,7 @@ private function setterAndGetterNormalizeSpec($spec, string $name, object $targe
break;

case 'setter_value':
if ('__SELF__' == $value) {
if ('__SELF__' === $value) {
$value = $target;
if (!isset($spec['setter_assert'])) {
$normalized['setter_assert'] = [static::class, 'assertSame'];
Expand Down

0 comments on commit d02137d

Please sign in to comment.