protected function tearDown() { // we can't simply do "$client->shutdown()" because sometimes // when an integration test fails (e.g. due to an error in the // container configuration) the $client property is set to null // (by PHPUnit?) and the original error is hidden behind a fatal // "Call to a member function shutdown() on a non-object"... if ($this->client instanceof TransactionalTestClient) { $this->client->shutdown(); } parent::tearDown(); }
protected function tearDown() { // we can't simply do "$client->shutdown()" because sometimes // when an integration test fails (e.g. due to an error in the // container configuration) the $client property is set to null // (by PHPUnit?) and the original error is hidden behind a fatal // "Call to a member function shutdown() on a non-object"... if ($this->client instanceof TransactionalTestClient) { $this->client->shutdown(); } // the following helps to free memory and speed up test suite execution. // see http://kriswallsmith.net/post/18029585104/faster-phpunit $refl = new \ReflectionObject($this); foreach ($refl->getProperties() as $prop) { if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) { $prop->setAccessible(true); $prop->setValue($this, null); } } parent::tearDown(); }
protected function tearDown() { $this->client->shutdown(); parent::tearDown(); }