Skip to content

Instantly share code, notes, and snippets.

@ahmed-abid
Last active March 29, 2018 10:32
Show Gist options
  • Save ahmed-abid/c246bc7e0c4a1a6a5e3481a98304b108 to your computer and use it in GitHub Desktop.
Save ahmed-abid/c246bc7e0c4a1a6a5e3481a98304b108 to your computer and use it in GitHub Desktop.
simple mock example
<?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