-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91ed39a
commit ac522a4
Showing
5 changed files
with
45 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/vendor | ||
composer.lock | ||
composer.lock | ||
coverage.clover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
] | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.8.0" | ||
"phpunit/phpunit": "~4.8.0", | ||
"10up/wp_mock": "0.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use WP_Queue\Exceptions\ConnectionNotFoundException; | ||
use WP_Queue\Queue; | ||
use WP_Queue\QueueManager; | ||
|
||
class TestQueueManager extends TestCase { | ||
|
||
public function setUp() { | ||
WP_Mock::setUp(); | ||
|
||
global $wpdb; | ||
$wpdb = Mockery::mock( 'WPDB' ); | ||
$wpdb->prefix = 'wp_'; | ||
} | ||
|
||
public function tearDown() { | ||
WP_Mock::tearDown(); | ||
} | ||
|
||
public function test_resolve() { | ||
$queue = QueueManager::resolve( 'database' ); | ||
$this->assertInstanceOf( Queue::class, $queue ); | ||
$queue = QueueManager::resolve( 'database' ); | ||
$this->assertInstanceOf( Queue::class, $queue ); | ||
} | ||
|
||
public function test_resolve_exception() { | ||
$this->setExpectedException( ConnectionNotFoundException::class); | ||
QueueManager::resolve( 'wibble' ); | ||
} | ||
} |