wrk-flow / larastrict

Opinionated extension of a Laravel framework to help you build type safe, testable and reusable code.
https://larastrict.com
MIT License
5 stars 2 forks source link

Command: Testing expectation - support closures #57

Closed pionl closed 6 months ago

pionl commented 1 year ago

If we are using closures, we can generate from closure typehints expected result and input parameters:

expectation would not create Closure $createData but

public readonly NotebookPageEntity $createDataPage,
        public readonly NotebookFinancePageEntity $createDataResultResult,
Assert::assertEquals($createData($expectation->createDataResultPage), $expectation->createDataResult, $message);
pionl commented 6 months ago

https://github.com/larastrict/strict-mock/issues/10