mirror of
https://github.com/danog/amp.git
synced 2024-11-27 04:24:42 +01:00
Change namespace to AsyncInterop
This commit is contained in:
parent
06ea46effb
commit
0c77b964fe
@ -5,12 +5,12 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0",
|
"php": ">=5.4.0",
|
||||||
"async-interop/promise": "^0.3|dev-master",
|
"async-interop/promise": "^0.3",
|
||||||
"phpunit/phpunit": "^4|^5"
|
"phpunit/phpunit": "^4|^5"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Interop\\Async\\Promise\\": "src"
|
"AsyncInterop\\Promise\\": "src"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
src/Test.php
12
src/Test.php
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Interop\Async\Promise;
|
namespace AsyncInterop\Promise;
|
||||||
|
|
||||||
use Interop\Async\Promise;
|
use AsyncInterop\Promise;
|
||||||
|
|
||||||
abstract class Test extends \PHPUnit_Framework_TestCase {
|
abstract class Test extends \PHPUnit_Framework_TestCase {
|
||||||
/**
|
/**
|
||||||
@ -51,11 +51,11 @@ abstract class Test extends \PHPUnit_Framework_TestCase {
|
|||||||
});
|
});
|
||||||
$this->assertTrue($invoked);
|
$this->assertTrue($invoked);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testSuccessAllWhensExecuted() {
|
function testSuccessAllWhensExecuted() {
|
||||||
list($promise, $succeeder) = $this->promise();
|
list($promise, $succeeder) = $this->promise();
|
||||||
$invoked = 0;
|
$invoked = 0;
|
||||||
|
|
||||||
$promise->when(function($e, $v) use (&$invoked) {
|
$promise->when(function($e, $v) use (&$invoked) {
|
||||||
$this->assertSame(null, $e);
|
$this->assertSame(null, $e);
|
||||||
$this->assertSame(true, $v);
|
$this->assertSame(true, $v);
|
||||||
@ -79,7 +79,7 @@ abstract class Test extends \PHPUnit_Framework_TestCase {
|
|||||||
$this->assertSame(true, $v);
|
$this->assertSame(true, $v);
|
||||||
$invoked++;
|
$invoked++;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertSame(4, $invoked);
|
$this->assertSame(4, $invoked);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ abstract class Test extends \PHPUnit_Framework_TestCase {
|
|||||||
});
|
});
|
||||||
$this->assertTrue($invoked);
|
$this->assertTrue($invoked);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFailureAllWhensExecuted() {
|
function testFailureAllWhensExecuted() {
|
||||||
list($promise, , $failer) = $this->promise();
|
list($promise, , $failer) = $this->promise();
|
||||||
$invoked = 0;
|
$invoked = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user