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

ThreadFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_create() 0 10 1
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