Last active
March 29, 2018 10:32
-
-
Save ahmed-abid/c246bc7e0c4a1a6a5e3481a98304b108 to your computer and use it in GitHub Desktop.
simple mock example
This file contains 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 | |
/** simple mock example */ | |
public function testTableName() | |
{ | |
$tableName = UserModel::tableName(); | |
$this->assertEquals('users', $tableName); | |
$userModel = Moke::double('App\AspectMock\UserModel', ['tableName' => 'my_users']); | |
$name = UserModel::tableName(); | |
$this->assertEquals('my_users', $name); | |
$userModel->verifyInvoked('tableName'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment