1
0
mirror of synced 2025-02-02 21:41:45 +03:00

#6167 Code review updates, better readability

This commit is contained in:
Michał Kurzeja 2016-12-12 20:03:25 +01:00 committed by Marco Pivetta
parent 71b040c849
commit 571115cf18
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629
2 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ class ConnectionMock extends Connection
*/
public function fetchColumn($statement, array $params = [], $colnum = 0, array $types = [])
{
if ($this->_fetchOneException != null) {
if (null !== $this->_fetchOneException) {
throw $this->_fetchOneException;
}
@ -136,7 +136,7 @@ class ConnectionMock extends Connection
}
/**
* @param \Exception $exception
* @param \Exception|null $exception
*
* @return void
*/
@ -168,7 +168,7 @@ class ConnectionMock extends Connection
/**
* @param Statement $result
*/
public function setQueryResult($result)
public function setQueryResult(Statement $result)
{
$this->_queryResult = $result;
}

View File

@ -25,12 +25,12 @@ class SequenceGeneratorTest extends OrmTestCase
public function testGeneration()
{
$this->_em->getConnection()->setFetchOneException(
new \Exception('Fetch* method used. Query method should be used instead, as NEXTVAL should be run on a master server in master-slave setup.')
new \RuntimeException('Fetch* method used. Query method should be used instead, as NEXTVAL should be run on a master server in master-slave setup.')
);
for ($i=0; $i < 42; ++$i) {
if ($i % 10 == 0) {
$nextId = array(array((int)($i / 10) * 10));
$nextId = [[(int)($i / 10) * 10]];
$this->_em->getConnection()->setQueryResult(new StatementArrayMock($nextId));
}
$id = $this->_seqGen->generate($this->_em, null);