public function testExecuteOperation() { $response = new PutIndexResponse(); $index = new YokozunaIndex(null, null); $operation = new StoreIndexOperation($index); $callback = function ($subject) { $this->assertInstanceOf('Riak\\Client\\Core\\Message\\Search\\PutIndexRequest', $subject); $this->assertEquals('schema-name', $subject->schema); $this->assertEquals('index-name', $subject->name); return true; }; $index->setName('index-name'); $index->setSchema('schema-name'); $this->adapter->expects($this->once())->method('send')->willReturn($response)->with($this->callback($callback)); $this->assertInstanceOf('Riak\\Client\\Command\\Search\\Response\\StoreIndexResponse', $operation->execute($this->adapter)); }