Open Journal Systems
3.3.0
NotifyingBatchTest.php
1
<?php
2
3
namespace
Guzzle\Tests\Batch
;
4
5
use
Guzzle\Batch\NotifyingBatch
;
6
use
Guzzle\Batch\Batch
;
7
11
class
NotifyingBatchTest
extends
\Guzzle\Tests\GuzzleTestCase
12
{
13
public
function
testNotifiesAfterFlush
()
14
{
15
$batch = $this->getMock(
'Guzzle\Batch\Batch'
, array(
'flush'
), array(
16
$this->getMock(
'Guzzle\Batch\BatchTransferInterface'
),
17
$this->getMock(
'Guzzle\Batch\BatchDivisorInterface'
)
18
));
19
20
$batch->expects($this->once())
21
->method(
'flush'
)
22
->will($this->returnValue(array(
'foo'
,
'baz'
)));
23
24
$data = array();
25
$decorator =
new
NotifyingBatch
($batch,
function
($batch) use (&$data) {
26
$data[] = $batch;
27
});
28
29
$decorator->
add
(
'foo'
)->add(
'baz'
);
30
$decorator->flush();
31
$this->assertEquals(array(array(
'foo'
,
'baz'
)), $data);
32
}
33
37
public
function
testEnsuresCallableIsValid
()
38
{
39
$batch =
new
Batch
(
40
$this->getMock(
'Guzzle\Batch\BatchTransferInterface'
),
41
$this->getMock(
'Guzzle\Batch\BatchDivisorInterface'
)
42
);
43
$decorator =
new
NotifyingBatch
($batch,
'foo'
);
44
}
45
}
Guzzle\Tests\GuzzleTestCase
Definition:
GuzzleTestCase.php:22
Guzzle\Tests\Batch\NotifyingBatchTest\testEnsuresCallableIsValid
testEnsuresCallableIsValid()
Definition:
NotifyingBatchTest.php:37
Guzzle\Batch\AbstractBatchDecorator\add
add($item)
Definition:
AbstractBatchDecorator.php:38
Guzzle\Tests\Batch\NotifyingBatchTest
Definition:
NotifyingBatchTest.php:11
Guzzle\Tests\Batch
Definition:
AbstractBatchDecoratorTest.php:3
Guzzle\Batch\Batch
Definition:
Batch.php:15
Guzzle\Batch\NotifyingBatch
Definition:
NotifyingBatch.php:10
Guzzle\Tests\Batch\NotifyingBatchTest\testNotifiesAfterFlush
testNotifiesAfterFlush()
Definition:
NotifyingBatchTest.php:13
plugins
paymethod
paypal
lib
vendor
guzzle
guzzle
tests
Guzzle
Tests
Batch
NotifyingBatchTest.php
Generated on Fri Aug 28 2020 14:52:53 for Open Journal Systems by
1.8.17