Browse Source

Fixing remaining failing tests in PHPUnit 3.6

mark_story 14 years ago
parent
commit
bfd95d0e04

+ 1 - 1
lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php

@@ -629,7 +629,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
  */
 	public function testAccepts() {
 		$_SERVER['HTTP_ACCEPT'] = 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
-		$this->assertEqual($this->RequestHandler->accepts(array('js', 'xml', 'html')), 'xml');
+		$this->assertTrue($this->RequestHandler->accepts(array('js', 'xml', 'html')));
 		$this->assertFalse($this->RequestHandler->accepts(array('gif', 'jpeg', 'foo')));
 
 		$_SERVER['HTTP_ACCEPT'] = '*/*;q=0.5';

+ 2 - 2
lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php

@@ -127,7 +127,7 @@ class SmtpTransportTest extends CakeTestCase {
 /**
  * testConnectFail method
  *
- * @expectedException Exception
+ * @expectedException SocketException
  * @return void
  */
 	public function testConnectFail() {
@@ -258,4 +258,4 @@ class SmtpTransportTest extends CakeTestCase {
 		$this->SmtpTransport->disconnect();
 	}
 
-}
+}

+ 0 - 6
lib/Cake/Test/Case/Routing/DispatcherTest.php

@@ -1298,12 +1298,6 @@ class DispatcherTest extends CakeTestCase {
 		$expected = filesize(CakePlugin::path('TestPlugin') . 'webroot' . DS . 'css' . DS . 'unknown.extension');
 		$headers = $response->header();
 		$this->assertEqual($expected, $headers['Content-Length']);
-
-		if (php_sapi_name() == 'cli') {
-			while (ob_get_level()) {
-				ob_get_clean();
-			}
-		}
 	}
 
 /**

+ 1 - 1
lib/Cake/Test/Case/Routing/RouterTest.php

@@ -2225,10 +2225,10 @@ class RouterTest extends CakeTestCase {
 /**
  * test that route classes must extend CakeRoute
  *
+ * @expectedException RouterException
  * @return void
  */
 	public function testCustomRouteException() {
-		$this->expectException();
 		Router::connect('/:controller', array(), array('routeClass' => 'Object'));
 	}
 

+ 1 - 1
lib/Cake/Test/Case/View/Helper/JsHelperTest.php

@@ -169,6 +169,7 @@ class JsHelperTest extends CakeTestCase {
 /**
  * test that methods dispatch internally and to the engine class
  *
+ * @expectedException PHPUnit_Framework_Error_Warning
  * @return void
  */
 	public function testMethodDispatching() {
@@ -182,7 +183,6 @@ class JsHelperTest extends CakeTestCase {
 		$this->Js->event('click', 'callback');
 
 		$this->Js->TestJsEngine = new StdClass();
-		$this->expectError();
 		$this->Js->someMethodThatSurelyDoesntExist();
 	}
 

+ 1 - 1
lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php

@@ -2175,6 +2175,7 @@ class PaginatorHelperTest extends CakeTestCase {
 /**
  * test that mock classes injected into paginatorHelper are called when using link()
  *
+ * @expectedException CakeException
  * @return void
  */
 	public function testMockAjaxProviderClassInjection() {
@@ -2196,7 +2197,6 @@ class PaginatorHelperTest extends CakeTestCase {
 		$Paginator->PaginatorMockJs->expects($this->once())->method('link');
 		$result = $Paginator->link('Page 2', array('page' => 2), array('update' => '#content'));
 
-		$this->expectException();
 		$Paginator = new PaginatorHelper($this->View, array('ajax' => 'Form'));
 	}