blob: 60d6f951abf471d585bd28b284412fc97f9e5758 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<?php
namespace Guzzle\Tests\Batch;
use Guzzle\Batch\HistoryBatch;
use Guzzle\Batch\Batch;
/**
* @covers Guzzle\Batch\HistoryBatch
*/
class HistoryBatchTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testMaintainsHistoryOfItemsAddedToBatch()
{
$batch = new Batch(
$this->getMock('Guzzle\Batch\BatchTransferInterface'),
$this->getMock('Guzzle\Batch\BatchDivisorInterface')
);
$history = new HistoryBatch($batch);
$history->add('foo')->add('baz');
$this->assertEquals(array('foo', 'baz'), $history->getHistory());
$history->clearHistory();
$this->assertEquals(array(), $history->getHistory());
}
}
|