Fixed ParamConverter tests
This commit is contained in:
parent
366a1e963e
commit
b4c67b6fff
|
@ -102,7 +102,7 @@ abstract class BookQuery extends ModelCriteria
|
|||
*
|
||||
* @return ChildBook|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
public function findPk($key, ConnectionInterface $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
|
@ -184,7 +184,7 @@ abstract class BookQuery extends ModelCriteria
|
|||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
public function findPks($keys, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
namespace Propel\PropelBundle\Tests\Fixtures\Model;
|
||||
|
||||
use Propel\PropelBundle\Tests\Fixtures\Model\Base\BookQuery as BaseBookQuery;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
|
||||
use Propel\PropelBundle\Tests\Fixtures\Model\Base\BookQuery as BaseBookQuery;
|
||||
use Propel\PropelBundle\Tests\Fixtures\Model\Book;
|
||||
|
||||
/**
|
||||
|
@ -24,7 +25,7 @@ class BookQuery extends BaseBookQuery
|
|||
/**
|
||||
* fake for test
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
public function findPk($key, ConnectionInterface $con = null)
|
||||
{
|
||||
if (1 === $key) {
|
||||
$book = new Book();
|
||||
|
@ -71,7 +72,7 @@ class BookQuery extends BaseBookQuery
|
|||
/**
|
||||
* fake for test
|
||||
*/
|
||||
public function findOne($con = null)
|
||||
public function findOne(ConnectionInterface $con = null)
|
||||
{
|
||||
if (true === $this->bySlug) {
|
||||
$book = new Book();
|
||||
|
|
|
@ -14,7 +14,6 @@ use Symfony\Component\Routing\RouteCollection;
|
|||
|
||||
class PropelParamConverterTest extends TestCase
|
||||
{
|
||||
|
||||
protected $con;
|
||||
|
||||
public function setUp()
|
||||
|
@ -357,15 +356,12 @@ class PropelParamConverterTest extends TestCase
|
|||
</table>
|
||||
</database>
|
||||
XML;
|
||||
$builder = new QuickBuilder();
|
||||
$builder->setSchema($schema);
|
||||
$classTargets = null;
|
||||
|
||||
if (class_exists('Propel\PropelBundle\Tests\Request\ParamConverter\MyAuthor')) {
|
||||
$classTargets = array();
|
||||
if (!class_exists('Propel\PropelBundle\Tests\Request\ParamConverter\MyAuthor')) {
|
||||
QuickBuilder::buildSchema($schema);
|
||||
}
|
||||
|
||||
$this->con = $builder->build($dsn = null, $user = null, $pass = null, $adapter = null, $classTargets);
|
||||
$this->con = Propel::getConnection('default');
|
||||
$this->con->useDebug(true);
|
||||
|
||||
MyBookQuery::create()->deleteAll($this->con);
|
||||
|
|
Loading…
Reference in a new issue