Skip to content

Instantly share code, notes, and snippets.

@ahmed-abid
Created March 29, 2018 10:40
Show Gist options
  • Save ahmed-abid/7db923cb3be835dbb16b788287492ada to your computer and use it in GitHub Desktop.
Save ahmed-abid/7db923cb3be835dbb16b788287492ada to your computer and use it in GitHub Desktop.
test No Dependency Injection Needed
<?php
/** no dependency injection example */
public function testNoDependencyInjectionNeeded(){
$object = new NoDependencyInjectionNeeded();
$original = $object->getName();
$this->assertEquals('users — No Dependency Injection Needed', $original);
Moke::double('App\AspectMock\UserModel', ['tableName' => 'my_users']);
$mokedName = $object->getName();
$this->assertEquals('my_users — No Dependency Injection Needed', $mokedName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment