public function testItShouldFlushWhenBeginAndEndAreCalled() { $this->client->expects($this->exactly(2))->method('bulk'); $this->bulk->addItem('idFoo', 'foo'); $this->bulk->begin(); $this->bulk->addItem('idFoo', 'foo'); $this->bulk->end(); }
public function testItShouldFlushWhenBeginAndEndAreCalled() { $bulkResponse = []; $bulkResponse['items'] = ['foo']; $bulkResponse['errors'] = false; $this->client->expects($this->exactly(2))->method('bulk')->willReturn($bulkResponse); $this->bulk->addItem('idFoo', 'foo'); $this->bulk->begin(); $this->bulk->addItem('idFoo', 'foo'); $this->bulk->end(); }