Commit 0157964f by Qiang Xue

Fixed test breaks.

parent c2343597
...@@ -56,7 +56,7 @@ class ViewRendererTest extends TestCase ...@@ -56,7 +56,7 @@ class ViewRendererTest extends TestCase
$view = $this->mockView(); $view = $this->mockView();
$content = $view->renderFile('@yiiunit/extensions/smarty/views/layout.tpl'); $content = $view->renderFile('@yiiunit/extensions/smarty/views/layout.tpl');
$this->assertEquals(1, preg_match('#<script src="/assets/[0-9a-z]+/jquery\\.js"></script>\s*</body>#', $content), 'Content does not contain the jquery js:' . $content); $this->assertEquals(1, preg_match('#<script src="/assets/[0-9a-z]+/dist/jquery\\.js"></script>\s*</body>#', $content), 'Content does not contain the jquery js:' . $content);
} }
......
...@@ -39,7 +39,7 @@ class ViewRendererTest extends DatabaseTestCase ...@@ -39,7 +39,7 @@ class ViewRendererTest extends DatabaseTestCase
$view = $this->mockView(); $view = $this->mockView();
$content = $view->renderFile('@yiiunit/extensions/twig/views/layout.twig'); $content = $view->renderFile('@yiiunit/extensions/twig/views/layout.twig');
$this->assertEquals(1, preg_match('#<script src="/assets/[0-9a-z]+/jquery\\.js"></script>\s*</body>#', $content), 'Content does not contain the jquery js:' . $content); $this->assertEquals(1, preg_match('#<script src="/assets/[0-9a-z]+/dist/jquery\\.js"></script>\s*</body>#', $content), 'Content does not contain the jquery js:' . $content);
} }
public function testAppGlobal() public function testAppGlobal()
......
...@@ -36,7 +36,7 @@ class CompareValidatorTest extends TestCase ...@@ -36,7 +36,7 @@ class CompareValidatorTest extends TestCase
$val = new CompareValidator(['compareValue' => $value]); $val = new CompareValidator(['compareValue' => $value]);
$val->operator = $op; $val->operator = $op;
foreach ($tests as $test) { foreach ($tests as $test) {
$this->assertEquals($test[1], $val->validate($test[0])); $this->assertEquals($test[1], $val->validate($test[0]), "Testing $op");
} }
} }
} }
...@@ -46,8 +46,8 @@ class CompareValidatorTest extends TestCase ...@@ -46,8 +46,8 @@ class CompareValidatorTest extends TestCase
return [ return [
'===' => [ '===' => [
[$value, true], [$value, true],
[(string) $value, false], [(string) $value, true],
[(float) $value, false], [(float) $value, true],
[$value + 1, false], [$value + 1, false],
], ],
'!=' => [ '!=' => [
...@@ -59,8 +59,8 @@ class CompareValidatorTest extends TestCase ...@@ -59,8 +59,8 @@ class CompareValidatorTest extends TestCase
], ],
'!==' => [ '!==' => [
[$value, false], [$value, false],
[(string) $value, true], [(string) $value, false],
[(float) $value, true], [(float) $value, false],
[false, true], [false, true],
], ],
'>' => [ '>' => [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment