1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-26 20:34:40 +01:00
parallel/test/Worker/DefaultWorkerFactoryTest.php
Aaron Piotrowski b654463339
Fix code style
2018-10-07 09:50:45 -05:00

36 lines
867 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());
}
}