You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpnamespaceTest\Contact;
useContact;
class ContactTest extends \TestCase
{
publicfunctiontestFindByName()
{
// You may mock your contact model first.$contact = $this->mockContact();
$contact->shouldReceive('where')->andReturn($contact)->shouldReceive('first')->andReturn($contact);
$this->assertEquals($contact, Contact::findByName('test'));
}
}
Please add some unit tests.
For example, in https://github.com/vtmer/vtmer-wechat/blob/da696d2dbb8646aa2318e0e4a5a4dd4dc2a4e4aa/app/controllers/WeixinEventHandler.php#L11,L30 , you can add a simple layer for retrieving contact information:
Then you can test
Contact
on methodfindByName
:References:
The text was updated successfully, but these errors were encountered: