Esempio n. 1
0
 public function testThreadIsRunning()
 {
     $thread = new TestThread();
     $this->assertTrue($thread->start());
     $this->assertTrue($thread->join());
     $this->assertTrue((bool) $thread->running);
 }
Esempio n. 2
0
 public function testThreadIsRunning()
 {
     $thread = new TestThread();
     $this->assertEquals($thread->start(), true);
     $this->assertEquals($thread->join(), true);
     $this->assertEquals($thread->running, true);
 }
Esempio n. 3
0
 function testJoin()
 {
     $thread1 = new TestThread(array('Hallo'));
     $thread2 = new TestThread(array('Eins', 'Zwei', 'Drei'));
     $thread1->join();
     $this->assertTrue(in_array('Hallo', self::$result));
     $this->assertTrue(in_array('Eins', self::$result));
     $this->assertFalse(in_array('Zwei', self::$result));
     $this->assertFalse(in_array('Drei', self::$result));
 }
Esempio n. 4
0
 public static function static_print($text)
 {
     $x = new TestThread();
     $x->print_ln($text);
 }