1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-13 17:47:32 +01:00
parallel/test/Worker/DefaultWorkerFactoryTest.php
Aaron Piotrowski c545be1dc5
More tests
2017-12-13 23:06:38 -06:00

32 lines
855 B
PHP

<?php
namespace Amp\Parallel\Test\Worker;
use Amp\Parallel\Worker\DefaultWorkerFactory;
use Amp\Parallel\Worker\Worker;
use Amp\PHPUnit\TestCase;
class DefaultWorkerFactoryTest extends TestCase {
/**
* @expectedException \Error
* @expectedExceptionMessage Invalid environment class name 'Invalid'
*/
public function testInvalidClassName() {
$factory = new DefaultWorkerFactory("Invalid");
}
/**
* @expectedException \Error
* @expectedExceptionMessage does not implement 'Amp\Parallel\Worker\Environment'
*/
public function testNonEnvironmentClassName() {
$factory = new DefaultWorkerFactory(DefaultWorkerFactory::class);
}
public function testCreate() {
$factory = new DefaultWorkerFactory;
$this->assertInstanceOf(Worker::class, $factory->create());
}
}