Browse Source

update of test cases

use assertTrue|False instead of `assertEquals`
QuickApps 12 years ago
parent
commit
78bee17033
1 changed files with 12 additions and 12 deletions
  1. 12 12
      tests/TestCase/Model/Behavior/TreeBehaviorTest.php

+ 12 - 12
tests/TestCase/Model/Behavior/TreeBehaviorTest.php

@@ -166,23 +166,23 @@ class TreeBehaviorTest extends TestCase {
 		$table->addBehavior('Tree', ['scope' => ['menu' => 'main-menu']]);
 
 		// top level, wont move
-		$this->assertEquals(false, $this->table->moveUp(1, 10));
+		$this->assertFalse($this->table->moveUp(1, 10));
 
 		// edge cases
-		$this->assertEquals(false, $this->table->moveUp(1, 0));
-		$this->assertEquals(false, $this->table->moveUp(1, -10));
+		$this->assertFalse($this->table->moveUp(1, 0));
+		$this->assertFalse($this->table->moveUp(1, -10));
 
 		// move unexisting node
-		$this->assertEquals(false, $table->moveUp(500, 1));
+		$this->assertFalse($table->moveUp(500, 1));
 
 		// move inner node
 		$result = $table->moveUp(3, 1);
 		$nodes = $table->find('children', ['for' => 1])->all();
 		$this->assertEquals([3, 4, 5, 2], $nodes->extract('id')->toArray());
-		$this->assertEquals(true, $result);
+		$this->assertTrue($result);
 
 		// move leaf
-		$this->assertEquals(false, $table->moveUp(5, 1));
+		$this->assertFalse($table->moveUp(5, 1));
 
 		// move to first position
 		$table->moveUp(8, true);
@@ -204,24 +204,24 @@ class TreeBehaviorTest extends TestCase {
 		$table->addBehavior('Tree', ['scope' => ['menu' => 'main-menu']]);
 
 		// latest node, wont move
-		$this->assertEquals(false, $this->table->moveDown(8, 10));
+		$this->assertFalse($this->table->moveDown(8, 10));
 
 		// edge cases
-		$this->assertEquals(false, $this->table->moveDown(8, 0));
-		$this->assertEquals(false, $this->table->moveUp(8, -10));
+		$this->assertFalse($this->table->moveDown(8, 0));
+		$this->assertFalse($this->table->moveUp(8, -10));
 
 		// move inner node
 		$nodeIds = [];
 		$result = $table->moveDown(2, 1);
 		$nodes = $table->find('children', ['for' => 1])->all();
 		$this->assertEquals([3, 4, 5, 2], $nodes->extract('id')->toArray());
-		$this->assertEquals(true, $result);
+		$this->assertTrue($result);
 
 		// move unexisting node
-		$this->assertEquals(false, $table->moveDown(500, 1));
+		$this->assertFalse($table->moveDown(500, 1));
 
 		// move leaf
-		$this->assertEquals(false, $table->moveDown(5, 1));
+		$this->assertFalse( $table->moveDown(5, 1));
 
 		// move to last position
 		$table->moveDown(1, true);