Last active
March 14, 2018 10:24
-
-
Save koertho/166b6e9e0b34b28a0440180f6deb64a7 to your computer and use it in GitHub Desktop.
Test original method without using the constructor in PHPUnit (usefull for Model or Module testing in Contao)
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 | |
| class ModelTest extends TestCase | |
| { | |
| public function getModelMock () | |
| { | |
| // The key is the null value to setMethod (default is [] which mocks all methods). | |
| $model = $this->getMockBuilder(FieldPaletteModel::class)->setMethods(null)->disableOriginalConstructor()->getMock(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment