Skip to content

Commit

Permalink
Restores previous driver after test finishes
Browse files Browse the repository at this point in the history
  • Loading branch information
artstorm committed Jul 23, 2015
1 parent 20b690c commit f50cd82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions api/tests/integration/QueueTest.php
Expand Up @@ -6,17 +6,28 @@
class QueueTest extends TestCase
{
protected $pheanstalk;
protected $originalDriver;

public function setUp()
{
parent::setUp();

// We'll use the beanstalkd queue driver for this test.
$this->originalDriver = getenv('QUEUE_DRIVER');
var_dump($this->originalDriver);
putenv('QUEUE_DRIVER=beanstalkd');

$this->pheanstalk = new Pheanstalk(env('BEANSTALKD_HOST'));
}

public function teardown()
{
parent::teardown();

// Restore the original driver
putenv('QUEUE_DRIVER='.$this->originalDriver);
}

/**
* Test queue is listening.
*/
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/UserTest.php
Expand Up @@ -14,7 +14,7 @@ public function setUp()

// We'll use the synchronous queue driver for this test, so we can test
// the email queue jobs.
putenv('QUEUE_DRIVER=sync');
// putenv('QUEUE_DRIVER=sync');
}

protected function createUser($type = 'admin')
Expand Down

0 comments on commit f50cd82

Please sign in to comment.