Last active
August 9, 2020 11:08
-
-
Save Chemaclass/07704606fcb337dbb0881c94197c329e to your computer and use it in GitHub Desktop.
Unit testing effectively - Logic example (Part I)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php declare(strict_types=1); | |
| namespace Company\Domain; | |
| final class MyBusinessLogic | |
| { | |
| private DependencyInterface $dependencyInterface; | |
| private ConcreteDependency $concrete; | |
| public function __construct( | |
| DependencyInterface $dependencyInterface, | |
| ConcreteDependency $concrete | |
| ) { | |
| $this->dependencyInterface = $dependencyInterface; | |
| $this->concrete = $concrete; | |
| } | |
| public function applySomeLogic(Input $input): ReturnType | |
| { | |
| // black box responsible to create a ReturnType | |
| // based on the given Input | |
| return $returnType; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment