From bd160975217230b881c870a7dc08d8daa4d80b22 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Fri, 9 Feb 2018 08:14:45 +0100 Subject: [PATCH] fixed testcases --- .travis.yml | 1 + src/PHPCR/Util/QOM/Sql2Scanner.php | 2 +- .../Console/Command/NodesUpdateCommandTest.php | 2 +- .../Tests/Util/QOM/Sql2ToQomQueryConverterTest.php | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 575f3aa..b61f75b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ sudo: false matrix: include: - php: 5.3 + dist: precise env: PACKAGE_VERSION=low before_script: diff --git a/src/PHPCR/Util/QOM/Sql2Scanner.php b/src/PHPCR/Util/QOM/Sql2Scanner.php index ac9a51c..49fd370 100644 --- a/src/PHPCR/Util/QOM/Sql2Scanner.php +++ b/src/PHPCR/Util/QOM/Sql2Scanner.php @@ -159,7 +159,7 @@ protected function scan($sql2) $token = strtok(" \n\t"); } - $regexp = ''; + $regexp = array(); foreach ($tokens as $token) { $regexp[] = preg_quote($token, '/'); } diff --git a/tests/PHPCR/Tests/Util/Console/Command/NodesUpdateCommandTest.php b/tests/PHPCR/Tests/Util/Console/Command/NodesUpdateCommandTest.php index db523a2..fe90059 100644 --- a/tests/PHPCR/Tests/Util/Console/Command/NodesUpdateCommandTest.php +++ b/tests/PHPCR/Tests/Util/Console/Command/NodesUpdateCommandTest.php @@ -88,7 +88,7 @@ public function testNodeUpdate($options) $this->setupQueryManager($options); $args = array( - '--query-language' => null, + '--query-language' => 'jcr-sql2', '--query' => $options['query'], '--no-interaction' => true, '--set-prop' => array(), diff --git a/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php b/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php index 15def8d..e1e4ac1 100644 --- a/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php +++ b/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php @@ -2,13 +2,27 @@ namespace PHPCR\Tests\Util\QOM; +use PHPCR\Query\QOM\QueryObjectModelFactoryInterface; use PHPCR\Util\QOM\Sql2ToQomQueryConverter; +use PHPCR\Util\ValueConverter; class Sql2ToQomQueryConverterTest extends \PHPUnit_Framework_TestCase { + /** + * @var QueryObjectModelFactoryInterface + */ protected $qomFactory; + + /** + * @var ValueConverter + */ protected $valueConverter; + /** + * @var Sql2ToQomQueryConverter + */ + protected $converter; + public function setUp() { $this->qomFactory = $this->getMock('PHPCR\Query\QOM\QueryObjectModelFactoryInterface');