Open Journal Systems  3.3.0
AbstractBatchDecoratorTest.php
1 <?php
2 
4 
6 
11 {
12  public function testProxiesToWrappedObject()
13  {
14  $batch = new Batch(
15  $this->getMock('Guzzle\Batch\BatchTransferInterface'),
16  $this->getMock('Guzzle\Batch\BatchDivisorInterface')
17  );
18 
19  $decoratorA = $this->getMockBuilder('Guzzle\Batch\AbstractBatchDecorator')
20  ->setConstructorArgs(array($batch))
21  ->getMockForAbstractClass();
22 
23  $decoratorB = $this->getMockBuilder('Guzzle\Batch\AbstractBatchDecorator')
24  ->setConstructorArgs(array($decoratorA))
25  ->getMockForAbstractClass();
26 
27  $decoratorA->add('foo');
28  $this->assertFalse($decoratorB->isEmpty());
29  $this->assertFalse($batch->isEmpty());
30  $this->assertEquals(array($decoratorB, $decoratorA), $decoratorB->getDecorators());
31  $this->assertEquals(array(), $decoratorB->flush());
32  }
33 }
Guzzle\Tests\GuzzleTestCase
Definition: GuzzleTestCase.php:22
Guzzle\Tests\Batch\AbstractBatchDecoratorTest
Definition: AbstractBatchDecoratorTest.php:10
Guzzle\Tests\Batch\AbstractBatchDecoratorTest\testProxiesToWrappedObject
testProxiesToWrappedObject()
Definition: AbstractBatchDecoratorTest.php:12
Guzzle\Tests\Batch
Definition: AbstractBatchDecoratorTest.php:3
Guzzle\Batch\Batch
Definition: Batch.php:15