Passed
Branch master (dae886)
by Alice
02:15
created

ThreadFactoryTest::test_create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Wonderland\Thread\Tests\Factory;
4
5
use PHPUnit\Framework\TestCase;
6
use Wonderland\Thread\Factory\ThreadFactory;
7
use Wonderland\Thread\Thread;
8
9
/**
10
 * Class ThreadFactoryTest
11
 * @package Wonderland\Thread\Tests\Factory
12
 * @author Alice Praud <[email protected]>
13
 */
14
class ThreadFactoryTest extends TestCase
15
{
16
17
	public function test_create()
18
	{
19
		$callback = function(){
20
  };
21
		$thread = new Thread();
22
		$thread->setProcessName('unit-test');
23
		$thread->setCallback($callback);
24
25
		$this->assertSame($thread->getCallback(), ThreadFactory::create('unit-test', $callback)->getCallback());
26
		$this->assertSame($thread->getProcessName(), ThreadFactory::create('unit-test', $callback)->getProcessName());
27
	}
28
29
}
30