diff --git a/src/Testing/Commands/MakeExpectationCommand.php b/src/Testing/Commands/MakeExpectationCommand.php index 35a3443b..6ed9532d 100644 --- a/src/Testing/Commands/MakeExpectationCommand.php +++ b/src/Testing/Commands/MakeExpectationCommand.php @@ -195,33 +195,33 @@ protected function generateExpectationMethodAssert( $assertClass->addMember($assertMethod); $assertMethod->addBody(sprintf( - '$expectation = $this->getExpectation(%s);', + '$_expectation = $this->getExpectation(%s);', $expectationClassName . '::class' )); $hookParameters = []; if ($parameters !== []) { - $assertMethod->addBody('$message = $this->getDebugMessage();'); + $assertMethod->addBody('$_message = $this->getDebugMessage();'); $assertMethod->addBody(''); foreach ($parameters as $parameter) { $hookParameters[] = sprintf('$%s', $parameter->name); $assertMethod->addBody(sprintf( - 'Assert::assertEquals($expectation->%s, $%s, $message);', + 'Assert::assertEquals($_expectation->%s, $%s, $_message);', $parameter->name, $parameter->name )); } } - $hookParameters[] = '$expectation'; + $hookParameters[] = '$_expectation'; $assertMethod->addBody(''); - $assertMethod->addBody(sprintf('if (is_callable($expectation->%s)) {', self::HookProperty)); + $assertMethod->addBody(sprintf('if (is_callable($_expectation->%s)) {', self::HookProperty)); $assertMethod->addBody(sprintf( - ' call_user_func($expectation->%s, %s);', + ' call_user_func($_expectation->%s, %s);', self::HookProperty, implode(', ', $hookParameters), )); @@ -240,7 +240,7 @@ protected function generateExpectationMethodAssert( switch ($enumReturnType) { case PhpType::Mixed: $assertMethod->addBody(''); - $assertMethod->addBody('return $expectation->return;'); + $assertMethod->addBody('return $_expectation->return;'); break; case PhpType::Self: case PhpType::Static: diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub index 4ed5f767..ffe19ef9 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/MultiFunctionContractAssert.php.stub @@ -53,15 +53,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp function self(string $first, int $second, bool $third): self { - $expectation = $this->getExpectation(MultiFunctionContractSelfExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractSelfExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -72,15 +72,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocThis(string $first, int $second, bool $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocThisExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocThisExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -95,15 +95,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocThisParams($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocThisParamsExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocThisParamsExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -114,18 +114,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocBool($first, $second, callable $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocBoolExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocBoolExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -133,18 +133,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocString($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocStringExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocStringExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -152,18 +152,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocFloat($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocFloatExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocFloatExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -171,18 +171,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocMixed($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocMixedExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocMixedExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -190,15 +190,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocStatic($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocStaticExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocStaticExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -209,58 +209,58 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function selfViaClass($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractSelfViaClassExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractSelfViaClassExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } function noReturn($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractNoReturnExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractNoReturnExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } } function mixed($first, $second, $third): mixed { - $expectation = $this->getExpectation(MultiFunctionContractMixedExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractMixedExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } function noParams(): string { - $expectation = $this->getExpectation(MultiFunctionContractNoParamsExpectation::class); + $_expectation = $this->getExpectation(MultiFunctionContractNoParamsExpectation::class); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php b/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php index 8b8e410d..cda3c2a7 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/SimpleActionContractAssert.php @@ -19,15 +19,15 @@ function __construct(array $execute = []) function execute(string $first, int $second, bool $third) { - $expectation = $this->getExpectation(SimpleActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(SimpleActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub index 1c072f16..4735098e 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestActionContractAssert.php.stub @@ -36,29 +36,29 @@ class TestActionContractAssert extends \LaraStrict\Testing\Assert\AbstractExpect \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): void { - $expectation = $this->getExpectation(TestActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub index 2e427897..9fd498a8 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnActionContractAssert.php.stub @@ -36,31 +36,31 @@ class TestReturnActionContractAssert extends \LaraStrict\Testing\Assert\Abstract \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): ?int { - $expectation = $this->getExpectation(TestReturnActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestReturnActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionContractAssert.php.stub index 09b63ed1..283a7eae 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/TestReturnUnionActionContractAssert.php.stub @@ -36,31 +36,31 @@ class TestReturnUnionActionContractAssert extends \LaraStrict\Testing\Assert\Abs \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): \LaraStrict\Testing\Laravel\TestingApplication|string|int|null { - $expectation = $this->getExpectation(TestReturnUnionActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestReturnUnionActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub index 96d6e621..1d83054d 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.MultiFunctionContractAssert.php.stub @@ -53,15 +53,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp function self(string $first, int $second, bool $third): self { - $expectation = $this->getExpectation(MultiFunctionContractSelfExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractSelfExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -72,15 +72,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocThis(string $first, int $second, bool $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocThisExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocThisExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -95,15 +95,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocThisParams($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocThisParamsExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocThisParamsExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -114,18 +114,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocBool($first, $second, callable $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocBoolExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocBoolExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -133,18 +133,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocString($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocStringExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocStringExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -152,18 +152,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocFloat($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocFloatExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocFloatExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -171,18 +171,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocMixed($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocMixedExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocMixedExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -190,15 +190,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocStatic($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocStaticExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocStaticExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -209,58 +209,58 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function selfViaClass($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractSelfViaClassExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractSelfViaClassExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } function noReturn($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractNoReturnExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractNoReturnExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } } function mixed($first, $second, $third): mixed { - $expectation = $this->getExpectation(MultiFunctionContractMixedExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractMixedExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } function noParams(): string { - $expectation = $this->getExpectation(MultiFunctionContractNoParamsExpectation::class); + $_expectation = $this->getExpectation(MultiFunctionContractNoParamsExpectation::class); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub index 667d1781..d9d68f45 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestActionContractAssert.php.stub @@ -36,29 +36,29 @@ class TestActionContractAssert extends \LaraStrict\Testing\Assert\AbstractExpect \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): void { - $expectation = $this->getExpectation(TestActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub index b343e98f..e5cfaa67 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnActionContractAssert.php.stub @@ -36,31 +36,31 @@ class TestReturnActionContractAssert extends \LaraStrict\Testing\Assert\Abstract \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): ?int { - $expectation = $this->getExpectation(TestReturnActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestReturnActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionContractAssert.php.stub index e4304845..031b75c1 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/one.TestReturnUnionActionContractAssert.php.stub @@ -36,31 +36,31 @@ class TestReturnUnionActionContractAssert extends \LaraStrict\Testing\Assert\Abs \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): \LaraStrict\Testing\Laravel\TestingApplication|string|int|null { - $expectation = $this->getExpectation(TestReturnUnionActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestReturnUnionActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub index 30190800..0614d4ef 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.MultiFunctionContractAssert.php.stub @@ -53,15 +53,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp function self(string $first, int $second, bool $third): self { - $expectation = $this->getExpectation(MultiFunctionContractSelfExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractSelfExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -72,15 +72,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocThis(string $first, int $second, bool $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocThisExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocThisExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -95,15 +95,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocThisParams($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocThisParamsExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocThisParamsExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -114,18 +114,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocBool($first, $second, callable $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocBoolExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocBoolExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -133,18 +133,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocString($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocStringExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocStringExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -152,18 +152,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocFloat($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocFloatExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocFloatExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -171,18 +171,18 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocMixed($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocMixedExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocMixedExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } /** @@ -190,15 +190,15 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function phpDocStatic($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractPhpDocStaticExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractPhpDocStaticExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } return $this; @@ -209,58 +209,58 @@ class MultiFunctionContractAssert extends \LaraStrict\Testing\Assert\AbstractExp */ function selfViaClass($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractSelfViaClassExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractSelfViaClassExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } function noReturn($first, $second, $third) { - $expectation = $this->getExpectation(MultiFunctionContractNoReturnExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractNoReturnExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } } function mixed($first, $second, $third): mixed { - $expectation = $this->getExpectation(MultiFunctionContractMixedExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(MultiFunctionContractMixedExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->first, $first, $message); - Assert::assertEquals($expectation->second, $second, $message); - Assert::assertEquals($expectation->third, $third, $message); + Assert::assertEquals($_expectation->first, $first, $_message); + Assert::assertEquals($_expectation->second, $second, $_message); + Assert::assertEquals($_expectation->third, $third, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $first, $second, $third, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $first, $second, $third, $_expectation); } - return $expectation->return; + return $_expectation->return; } function noParams(): string { - $expectation = $this->getExpectation(MultiFunctionContractNoParamsExpectation::class); + $_expectation = $this->getExpectation(MultiFunctionContractNoParamsExpectation::class); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub index a9064126..32ea0385 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestActionContractAssert.php.stub @@ -36,29 +36,29 @@ class TestActionContractAssert extends \LaraStrict\Testing\Assert\AbstractExpect \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): void { - $expectation = $this->getExpectation(TestActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub index 7ee2587f..88a8c24d 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnActionContractAssert.php.stub @@ -36,31 +36,31 @@ class TestReturnActionContractAssert extends \LaraStrict\Testing\Assert\Abstract \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): ?int { - $expectation = $this->getExpectation(TestReturnActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestReturnActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionContractAssert.php.stub b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionContractAssert.php.stub index 93e2c3fa..8dde3936 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionContractAssert.php.stub +++ b/tests/Feature/Testing/Commands/MakeExpectationCommand/two.TestReturnUnionActionContractAssert.php.stub @@ -36,31 +36,31 @@ class TestReturnUnionActionContractAssert extends \LaraStrict\Testing\Assert\Abs \LaraStrict\Testing\Laravel\TestingApplication $object = new \LaraStrict\Testing\Laravel\TestingApplication(/* unknown */), \ArrayAccess&\Illuminate\Support\Enumerable $intersectionType = new \Illuminate\Support\Collection(/* unknown */), ): \LaraStrict\Testing\Laravel\TestingApplication|string|int|null { - $expectation = $this->getExpectation(TestReturnUnionActionContractExpectation::class); - $message = $this->getDebugMessage(); + $_expectation = $this->getExpectation(TestReturnUnionActionContractExpectation::class); + $_message = $this->getDebugMessage(); - Assert::assertEquals($expectation->int, $int, $message); - Assert::assertEquals($expectation->string, $string, $message); - Assert::assertEquals($expectation->noTypeHint, $noTypeHint, $message); - Assert::assertEquals($expectation->type, $type, $message); - Assert::assertEquals($expectation->testingApplication, $testingApplication, $message); - Assert::assertEquals($expectation->multi, $multi, $message); - Assert::assertEquals($expectation->multiNull, $multiNull, $message); - Assert::assertEquals($expectation->multiNullDefault, $multiNullDefault, $message); - Assert::assertEquals($expectation->optional, $optional, $message); - Assert::assertEquals($expectation->optionalString, $optionalString, $message); - Assert::assertEquals($expectation->constant, $constant, $message); - Assert::assertEquals($expectation->constantClass, $constantClass, $message); - Assert::assertEquals($expectation->enumDefault, $enumDefault, $message); - Assert::assertEquals($expectation->noTypeHintDefault, $noTypeHintDefault, $message); - Assert::assertEquals($expectation->customConstants, $customConstants, $message); - Assert::assertEquals($expectation->object, $object, $message); - Assert::assertEquals($expectation->intersectionType, $intersectionType, $message); + Assert::assertEquals($_expectation->int, $int, $_message); + Assert::assertEquals($_expectation->string, $string, $_message); + Assert::assertEquals($_expectation->noTypeHint, $noTypeHint, $_message); + Assert::assertEquals($_expectation->type, $type, $_message); + Assert::assertEquals($_expectation->testingApplication, $testingApplication, $_message); + Assert::assertEquals($_expectation->multi, $multi, $_message); + Assert::assertEquals($_expectation->multiNull, $multiNull, $_message); + Assert::assertEquals($_expectation->multiNullDefault, $multiNullDefault, $_message); + Assert::assertEquals($_expectation->optional, $optional, $_message); + Assert::assertEquals($_expectation->optionalString, $optionalString, $_message); + Assert::assertEquals($_expectation->constant, $constant, $_message); + Assert::assertEquals($_expectation->constantClass, $constantClass, $_message); + Assert::assertEquals($_expectation->enumDefault, $enumDefault, $_message); + Assert::assertEquals($_expectation->noTypeHintDefault, $noTypeHintDefault, $_message); + Assert::assertEquals($_expectation->customConstants, $customConstants, $_message); + Assert::assertEquals($_expectation->object, $object, $_message); + Assert::assertEquals($_expectation->intersectionType, $intersectionType, $_message); - if (is_callable($expectation->hook)) { - call_user_func($expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $expectation); + if (is_callable($_expectation->hook)) { + call_user_func($_expectation->hook, $int, $string, $noTypeHint, $type, $testingApplication, $multi, $multiNull, $multiNullDefault, $optional, $optionalString, $constant, $constantClass, $enumDefault, $noTypeHintDefault, $customConstants, $object, $intersectionType, $_expectation); } - return $expectation->return; + return $_expectation->return; } } diff --git a/tests/Feature/Testing/Commands/MakeExpectationCommandTest.php b/tests/Feature/Testing/Commands/MakeExpectationCommandTest.php index fb4de6a1..cd045a48 100644 --- a/tests/Feature/Testing/Commands/MakeExpectationCommandTest.php +++ b/tests/Feature/Testing/Commands/MakeExpectationCommandTest.php @@ -28,7 +28,7 @@ class MakeExpectationCommandTest extends TestCase private MockInterface $fileSystem; - private static ?bool $stubsGenerated = null; + private static ?bool $stubsGenerated = true; protected function setUp(): void {