Browse Source

Fix tests.

dereuromark 9 years ago
parent
commit
3244db9db9

+ 2 - 0
tests/TestCase/View/Helper/FlashHelperTest.php

@@ -23,6 +23,8 @@ use Cake\View\View;
 
 /**
  * FlashHelperTest class
+ *
+ * @property \Cake\View\Helper\FlashHelper $Flash
  */
 class FlashHelperTest extends TestCase
 {

+ 3 - 3
tests/TestCase/View/Helper/FormHelperTest.php

@@ -108,7 +108,7 @@ class ValidateUsersTable extends Table
 /**
  * FormHelperTest class
  *
- * @property FormHelper $Form
+ * @property \Cake\View\Helper\FormHelper $Form
  */
 class FormHelperTest extends TestCase
 {
@@ -250,7 +250,7 @@ class FormHelperTest extends TestCase
             'val' => 1
         ];
         $mock = $this->getMockBuilder('Cake\View\Widget\WidgetInterface')->getMock();
-        $this->assertNull($this->Form->addWidget('test', $mock));
+        $this->Form->addWidget('test', $mock);
         $mock->expects($this->once())
             ->method('render')
             ->with($data)
@@ -272,7 +272,7 @@ class FormHelperTest extends TestCase
             'name' => 'test'
         ];
         $mock = $this->getMockBuilder('Cake\View\Widget\WidgetInterface')->getMock();
-        $this->assertNull($this->Form->addWidget('test', $mock));
+        $this->Form->addWidget('test', $mock);
 
         $mock->expects($this->at(0))
             ->method('render')

+ 5 - 0
tests/TestCase/View/Helper/RssHelperTest.php

@@ -29,6 +29,11 @@ class RssHelperTest extends TestCase
 {
 
     /**
+     * @var \Cake\View\Helper\RssHelper
+     */
+    public $Rss;
+
+    /**
      * setUp method
      *
      * @return void

+ 6 - 1
tests/TestCase/View/Helper/TextHelperTest.php

@@ -51,6 +51,11 @@ class TextHelperTest extends TestCase
 {
 
     /**
+     * @var \Cake\View\Helper\TextHelper
+     */
+    public $Text;
+
+    /**
      * setUp method
      *
      * @return void
@@ -450,7 +455,7 @@ class TextHelperTest extends TestCase
     /**
      * Data provider for autoLinkEmail.
      *
-     * @return void
+     * @return array
      */
     public function autoLinkEmailProvider()
     {

+ 11 - 3
tests/TestCase/View/Helper/TimeHelperTest.php

@@ -27,7 +27,15 @@ use Cake\View\View;
 class TimeHelperTest extends TestCase
 {
 
-    public $Time = null;
+    /**
+     * @var \Cake\View\Helper\TimeHelper
+     */
+    public $Time;
+
+    /**
+     * @var string
+     */
+    public $locale;
 
     /**
      * setUp method
@@ -183,7 +191,7 @@ class TimeHelperTest extends TestCase
      */
     public function testToUnix()
     {
-        $this->assertSame(1397980800, $this->Time->toUnix('2014-04-20 08:00:00'));
+        $this->assertSame('1397980800', $this->Time->toUnix('2014-04-20 08:00:00'));
     }
 
     /**
@@ -599,7 +607,7 @@ class TimeHelperTest extends TestCase
      */
     public function assertTimeFormat($expected, $result)
     {
-        return $this->assertEquals(
+        $this->assertEquals(
             str_replace([',', '(', ')', ' at', ' à'], '', $expected),
             str_replace([',', '(', ')', ' at', ' à'], '', $result)
         );

+ 5 - 0
tests/TestCase/View/Helper/UrlHelperTest.php

@@ -29,6 +29,11 @@ class UrlHelperTest extends TestCase
 {
 
     /**
+     * @var \Cake\View\Helper\UrlHelper
+     */
+    public $Helper;
+
+    /**
      * setUp method
      *
      * @return void