/** * executed before each test */ protected function _before() { if (!defined('TEST_BT_HOST') || !defined('TEST_BT_PORT')) { $this->markTestSkipped('TEST_BT_HOST and/or TEST_BT_PORT env variables are not defined'); } $this->client = new Extended(['host' => TEST_BT_HOST, 'port' => TEST_BT_PORT, 'prefix' => 'PHPUnit_']); if (!$this->client->connect()) { $this->markTestSkipped(sprintf('Need a running beanstalkd server at %s:%d', TEST_BT_HOST, TEST_BT_PORT)); } $this->shmKey = round(microtime(true) * 1000); }
protected function setUp() { $host = getenv('TEST_BS_HOST'); $port = getenv('TEST_BS_PORT'); if (empty($host) || empty($port)) { $this->markTestSkipped('TEST_BS_HOST and/or TEST_BS_PORT env variables are not defined'); } $this->client = new Extended(['host' => $host, 'port' => $port, 'prefix' => 'PHPUnit_']); if (!$this->client->connect()) { $this->markTestSkipped(sprintf('Need a running beanstalkd server at %s:%d', $host, $port)); } self::$shmKey = round(microtime(true) * 1000); }