1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Moved CustomTreeWalkersJoinTest to proper namespace and fixed licence

This commit is contained in:
Lukasz Cybula 2012-10-12 09:33:40 +02:00
parent 2c99ecf586
commit 7b1d84cbdb

View File

@ -13,37 +13,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\Tests\ORM\Functional;
namespace Doctrine\Tests\ORM\Query;
use Doctrine\ORM\Query;
require_once __DIR__ . '/../../TestInit.php';
/**
* Test case for custom AST walking and adding new joins.
*
* @author Lukasz Cybula <lukasz.cybula@fsi.pl>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license MIT
* @link http://www.doctrine-project.org
*/
class CustomTreeWalkersJoinTest extends \Doctrine\Tests\OrmTestCase
{
private $_em;
private $em;
protected function setUp()
{
$this->_em = $this->_getTestEntityManager();
$this->em = $this->_getTestEntityManager();
}
public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed)
{
try {
$query = $this->_em->createQuery($dqlToBeTested);
$query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\Tests\ORM\Functional\CustomTreeWalker2'))
$query = $this->em->createQuery($dqlToBeTested);
$query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('Doctrine\Tests\ORM\Query\CustomTreeWalkerJoin'))
->useQueryCache(false);
$this->assertEquals($sqlToBeConfirmed, $query->getSql());
@ -71,7 +69,7 @@ class CustomTreeWalkersJoinTest extends \Doctrine\Tests\OrmTestCase
}
}
class CustomTreeWalker2 extends Query\TreeWalkerAdapter
class CustomTreeWalkerJoin extends Query\TreeWalkerAdapter
{
public function walkSelectStatement(Query\AST\SelectStatement $selectStatement)
{