mercredi 8 juillet 2015

phpunit Google_Client mock

Attempting to do some unit testing for a GA processing class, but I can't figure out how to correctly mock the client object. I'm getting this error with the mock code below.

Call to undefined method Google_Client::__phpunit_cleanup()

public function getMockGaClient() {
    return $this->getMockBuilder('Google_Client')
        ->setMockClassName('Google_Client')
        ->getMock();
}

to be a bit preemptive, I'm setting the mock name so it passes a parameter check.

Aucun commentaire:

Enregistrer un commentaire