Exemplo n.º 1
0
 /**
  * @return void
  */
 public function testAdd()
 {
     $message = 'foo bar baz';
     /** @var $client PHPUnit_Framework_MockObject_MockObject|JobPoolIf */
     $client = $this->getMock('JobPoolIf');
     $client->expects($this->once())->method('add')->with($this->equalTo('foo'), $this->equalTo($message));
     $consumer = new jp_producer_Text('foo', array('client' => $client));
     $consumer->add($message);
 }
Exemplo n.º 2
0
#!/usr/bin/php
<?php 
$jpRoot = dirname(__FILE__) . '/../../';
set_include_path(get_include_path() . PATH_SEPARATOR . $jpRoot . 'lib/php' . PATH_SEPARATOR . $jpRoot . 'gen-php/jp');
require_once 'jp/producer/Text.php';
$producer = new jp_producer_Text('text');
for ($i = 0; $i < 100; $i++) {
    $producer->add('simple pizza');
}