Skip to content

Commit

Permalink
Use the right indention
Browse files Browse the repository at this point in the history
  • Loading branch information
Baachi committed Jun 20, 2012
1 parent 76530e8 commit f4ba01a
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions tests/Doctrine/Tests/KeyValueStore/Storage/RiakStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class RiakStorageTest extends \PHPUnit_Framework_TestCase
protected function setup()
{
$this->riak = $this->getMockBuilder('Riak\\Client')
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();


$this->storage = new RiakStorage($this->riak, 'test');
$this->storage = new RiakStorage($this->riak);
}

public function testSupportsPartialUpdates()
Expand Down Expand Up @@ -55,30 +55,30 @@ public function testInsert()
->will($this->returnValue($bucket));

$objectMock = $this->getMockBuilder('Riak\Object')
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();

$objectMock->expects($this->once())
->method('store');
->method('store');


$that = $this;
$bucket->expects($this->once())
->method('newObject')
->will($this->returnCallback(function($key, $data) use ($objectMock, $that) {
$that->assertEquals('foobar', $key);
$that->assertEquals(array('title' => 'Riak test'), $data);
return $objectMock;
}));
->method('newObject')
->will($this->returnCallback(function($key, $data) use ($objectMock, $that) {
$that->assertEquals('foobar', $key);
$that->assertEquals(array('title' => 'Riak test'), $data);
return $objectMock;
}));

$this->storage->insert('riak-test', 'foobar', array('title' => 'Riak test'));
}

public function testUpdate()
{
$objectMock = $this->getMockBuilder('Riak\Object')
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();

$bucket = $this->getMockBuilder('Riak\Bucket')
->disableOriginalConstructor()
Expand All @@ -95,13 +95,13 @@ public function testUpdate()

$that = $this;
$objectMock->expects($this->once())
->method('setData')
->will($this->returnCallback(function($data) use ($that) {
$that->assertEquals(array('title' => 'Riak cookbook'), $data);
}));
->method('setData')
->will($this->returnCallback(function($data) use ($that) {
$that->assertEquals(array('title' => 'Riak cookbook'), $data);
}));

$objectMock->expects($this->once())
->method('store');
->method('store');

$this->storage->update('riak-test', 'foobar', array('title' => 'Riak cookbook'));
}
Expand All @@ -126,11 +126,11 @@ public function testDelete()
->will($this->returnValue($objectMock));

$objectMock->expects($this->once())
->method('exists')
->will($this->returnValue(true));
->method('exists')
->will($this->returnValue(true));

$objectMock->expects($this->once())
->method('delete');
->method('delete');

$this->storage->delete('riak-test', 'foobar');
}
Expand Down Expand Up @@ -184,12 +184,12 @@ public function testFind()
->will($this->returnValue($objectMock));

$objectMock->expects($this->once())
->method('exists')
->will($this->returnValue(true));
->method('exists')
->will($this->returnValue(true));

$objectMock->expects($this->once())
->method('getData')
->will($this->returnValue(array('title' => 'Riak Test')));
->method('getData')
->will($this->returnValue(array('title' => 'Riak Test')));

$this->assertEquals(array('title' => 'Riak Test'), $this->storage->find('riaktest', 'foobar'));
}
Expand Down

0 comments on commit f4ba01a

Please sign in to comment.