Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase #105

Merged
merged 2 commits into from
Nov 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 4 additions & 3 deletions tests/FulfilledPromiseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public function getPromiseTestAdapter(callable $canceller = null)
]);
}

/** @test */
/**
* @test
* @expectedException InvalidArgumentException
*/
public function shouldThrowExceptionIfConstructedWithAPromise()
{
$this->setExpectedException('\InvalidArgumentException');

return new FulfilledPromise(new FulfilledPromise());
}
}
8 changes: 5 additions & 3 deletions tests/Internal/CancellationQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ public function doesNotCallCancelTwiceWhenStartedTwice()
$cancellationQueue();
}

/** @test */
/**
* @test
* @expectedException Exception
* @expectedExceptionMessage test
*/
public function rethrowsExceptionsThrownFromCancel()
{
$this->setExpectedException('\Exception', 'test');

$mock = $this->createCallableMock();
$mock
->expects($this->once())
Expand Down
8 changes: 5 additions & 3 deletions tests/Internal/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ public function excutesNestedEnqueuedTasks()
$queue->enqueue($task);
}

/** @test */
/**
* @test
* @expectedException Exception
* @expectedException test
*/
public function rethrowsExceptionsThrownFromTasks()
{
$this->setExpectedException('\Exception', 'test');

$mock = $this->createCallableMock();
$mock
->expects($this->once())
Expand Down
7 changes: 4 additions & 3 deletions tests/RejectedPromiseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public function getPromiseTestAdapter(callable $canceller = null)
]);
}

/** @test */
/**
* @test
* @expectedException InvalidArgumentException
*/
public function shouldThrowExceptionIfConstructedWithAPromise()
{
$this->setExpectedException('\InvalidArgumentException');

return new RejectedPromise(new RejectedPromise());
}
}
4 changes: 3 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace React\Promise;

class TestCase extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase as BaseTestCase;

class TestCase extends BaseTestCase
{
public function expectCallableExactly($amount)
{
Expand Down