#6167 Code review updates, better readability
This commit is contained in:
parent
71b040c849
commit
571115cf18
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user