Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[#3878] CS fixes
Browse files Browse the repository at this point in the history
- linefeed, trailing spaces
  • Loading branch information
weierophinney committed Mar 11, 2013
1 parent 969a275 commit 0fc1501
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Paginator/Adapter/DbTableGateway.php
Expand Up @@ -16,7 +16,7 @@ class DbTableGateway extends DbSelect
{
/**
* Construnct
*
*
* @param TableGateway $tableGateway
* @param Where|\Closure|string|array $where
*/
Expand All @@ -25,7 +25,7 @@ public function __construct(TableGateway $tableGateway, $where = null)
$select = $tableGateway->getSql()->select($where);
$dbAdapter = $tableGateway->getAdapter();
$resultSetPrototype = $tableGateway->getResultSetPrototype();

parent::__construct($select, $dbAdapter, $resultSetPrototype);
}
}
60 changes: 30 additions & 30 deletions tests/ZendTest/Paginator/Adapter/DbTableGatewayTest.php
Expand Up @@ -14,67 +14,67 @@
use Zend\Paginator\Adapter\DbSelect;
use Zend\Db\ResultSet\ResultSet;

/**
* @group Zend_Paginator
/**
* @group Zend_Paginator
*/
class DbTableGatewayTest extends \PHPUnit_Framework_TestCase
{
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $mockStatement;
/** @var DbTableGateway */
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $mockStatement;

/** @var DbTableGateway */
protected $dbTableGateway;
public function setup()
{
$mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface');
$mockDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface');

public function setup()
{
$mockStatement = $this->getMock('Zend\Db\Adapter\Driver\StatementInterface');
$mockDriver = $this->getMock('Zend\Db\Adapter\Driver\DriverInterface');
$mockDriver->expects($this->any())
->method('createStatement')
->will($this->returnValue($mockStatement));
$mockPlatform = $this->getMock('Zend\Db\Adapter\Platform\PlatformInterface');
->will($this->returnValue($mockStatement));
$mockPlatform = $this->getMock('Zend\Db\Adapter\Platform\PlatformInterface');
$mockPlatform->expects($this->any())
->method('getName')
->will($this->returnValue('platform'));
->will($this->returnValue('platform'));
$mockAdapter = $this->getMockForAbstractClass(
'Zend\Db\Adapter\Adapter',
'Zend\Db\Adapter\Adapter',
array($mockDriver, $mockPlatform)
);
);

$tableName = 'foobar';
$mockTableGateway = $this->getMockForAbstractClass(
'Zend\Db\TableGateway\TableGateway',
array($tableName, $mockAdapter)
);

$this->mockStatement = $mockStatement;
$this->dbTableGateway = new DbTableGateway($mockTableGateway);
$this->dbTableGateway = new DbTableGateway($mockTableGateway);
}
public function testGetItems()
{

public function testGetItems()
{
$mockResult = $this->getMock('Zend\Db\Adapter\Driver\ResultInterface');
$this->mockStatement
->expects($this->any())
->method('execute')
->will($this->returnValue($mockResult));

$items = $this->dbTableGateway->getItems(2, 10);
$this->assertInstanceOf('Zend\Db\ResultSet\ResultSet', $items);
$this->assertInstanceOf('Zend\Db\ResultSet\ResultSet', $items);
}

public function testCount()
{
{
$mockResult = $this->getMock('Zend\Db\Adapter\Driver\ResultInterface');
$mockResult->expects($this->any())
->method('current')
->will($this->returnValue(array('c' => 10)));

$this->mockStatement->expects($this->any())
->method('execute')
->will($this->returnValue($mockResult));
$count = $this->dbTableGateway->count();
$this->assertEquals(10, $count);

$count = $this->dbTableGateway->count();
$this->assertEquals(10, $count);
}
}

0 comments on commit 0fc1501

Please sign in to comment.