Browse Source

Fixed test breaks.

tags/2.0.0-rc
Qiang Xue 10 years ago
parent
commit
0157964f5f
  1. 2
      tests/unit/extensions/smarty/ViewRendererTest.php
  2. 2
      tests/unit/extensions/twig/ViewRendererTest.php
  3. 10
      tests/unit/framework/validators/CompareValidatorTest.php

2
tests/unit/extensions/smarty/ViewRendererTest.php

@ -56,7 +56,7 @@ class ViewRendererTest extends TestCase
$view = $this->mockView();
$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);
}

2
tests/unit/extensions/twig/ViewRendererTest.php

@ -39,7 +39,7 @@ class ViewRendererTest extends DatabaseTestCase
$view = $this->mockView();
$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()

10
tests/unit/framework/validators/CompareValidatorTest.php

@ -36,7 +36,7 @@ class CompareValidatorTest extends TestCase
$val = new CompareValidator(['compareValue' => $value]);
$val->operator = $op;
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
return [
'===' => [
[$value, true],
[(string) $value, false],
[(float) $value, false],
[(string) $value, true],
[(float) $value, true],
[$value + 1, false],
],
'!=' => [
@ -59,8 +59,8 @@ class CompareValidatorTest extends TestCase
],
'!==' => [
[$value, false],
[(string) $value, true],
[(float) $value, true],
[(string) $value, false],
[(float) $value, false],
[false, true],
],
'>' => [

Loading…
Cancel
Save