flush
[m6w6/seekat] / tests / ErrorsTest.php
1 <?php
2
3 class ErrorsTest extends BaseTest
4 {
5 use ConsumePromise;
6 use AssertCancelled;
7 use AssertFailure;
8
9 /**
10 * @dataProvider provideAPI
11 */
12 function testCancellation($api) {
13 $promise = $api->users->m6w6();
14
15 if (!$api->getFuture()->cancelPromise($promise)) {
16 return;
17 }
18
19 $this->assertCancelled($promise);
20 }
21
22 /**
23 * @dataProvider provideAPI
24 */
25 function test404($api) {
26 $error = $this->assertFailure($api->generate->a404);
27 $this->assertEquals($error->getMessage(), "Not Found");
28 }
29 }