Browse Source

Merge pull request #8607 from cakephp/fix-travis-test

Fixing travis again
José Lorenzo Rodríguez 10 years ago
parent
commit
28c225048b
1 changed files with 57 additions and 10 deletions
  1. 57 10
      tests/TestCase/Database/QueryTest.php

+ 57 - 10
tests/TestCase/Database/QueryTest.php

@@ -434,7 +434,7 @@ class QueryTest extends TestCase
      *
      * @return void
      */
-    public function testSelectWhereOperators()
+    public function testSelectWhereOperatorMoreThan()
     {
         $query = new Query($this->connection);
         $result = $query
@@ -445,7 +445,15 @@ class QueryTest extends TestCase
         $this->assertCount(2, $result);
         $this->assertEquals(['comment' => 'First Comment for Second Article'], $result->fetch('assoc'));
         $result->closeCursor();
+    }
 
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorLessThan()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])
@@ -455,7 +463,15 @@ class QueryTest extends TestCase
         $this->assertCount(1, $result);
         $this->assertEquals(['title' => 'First Article'], $result->fetch('assoc'));
         $result->closeCursor();
+    }
 
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorLessThanEqual()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])
@@ -464,7 +480,15 @@ class QueryTest extends TestCase
             ->execute();
         $this->assertCount(2, $result);
         $result->closeCursor();
+    }
 
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorMoreThanEqual()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])
@@ -473,16 +497,15 @@ class QueryTest extends TestCase
             ->execute();
         $this->assertCount(3, $result);
         $result->closeCursor();
+    }
 
-        $query = new Query($this->connection);
-        $result = $query
-            ->select(['title'])
-            ->from('articles')
-            ->where(['id <=' => 1])
-            ->execute();
-        $this->assertCount(1, $result);
-        $result->closeCursor();
-
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorNotEqual()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])
@@ -492,7 +515,15 @@ class QueryTest extends TestCase
         $this->assertCount(2, $result);
         $this->assertEquals(['title' => 'First Article'], $result->fetch('assoc'));
         $result->closeCursor();
+    }
 
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorLike()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])
@@ -502,7 +533,15 @@ class QueryTest extends TestCase
         $this->assertCount(1, $result);
         $this->assertEquals(['title' => 'First Article'], $result->fetch('assoc'));
         $result->closeCursor();
+    }
 
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorLikeExpansion()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])
@@ -511,7 +550,15 @@ class QueryTest extends TestCase
             ->execute();
         $this->assertCount(3, $result);
         $result->closeCursor();
+    }
 
+    /**
+     * Tests using where conditions with operators and scalar values works
+     *
+     * @return void
+     */
+    public function testSelectWhereOperatorNotLike()
+    {
         $query = new Query($this->connection);
         $result = $query
             ->select(['title'])