Browse files

Fixing remaining failing tests in PHPUnit 3.6

  • Loading branch information...
1 parent d68053c commit bfd95d0e04235396b5011b790042765da856d4ea @markstory markstory committed Nov 3, 2011
View
2 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
@@ -629,7 +629,7 @@ public function testMapAlias() {
*/
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';
View
4 lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php
@@ -127,7 +127,7 @@ public function testConnectHelo() {
/**
* testConnectFail method
*
- * @expectedException Exception
+ * @expectedException SocketException
* @return void
*/
public function testConnectFail() {
@@ -258,4 +258,4 @@ public function testQuit() {
$this->SmtpTransport->disconnect();
}
-}
+}
View
6 lib/Cake/Test/Case/Routing/DispatcherTest.php
@@ -1298,12 +1298,6 @@ public function testAssets() {
$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();
- }
- }
}
/**
View
2 lib/Cake/Test/Case/Routing/RouterTest.php
@@ -2225,10 +2225,10 @@ public function testUsingCustomRouteClass() {
/**
* test that route classes must extend CakeRoute
*
+ * @expectedException RouterException
* @return void
*/
public function testCustomRouteException() {
- $this->expectException();
Router::connect('/:controller', array(), array('routeClass' => 'Object'));
}
View
2 lib/Cake/Test/Case/View/Helper/JsHelperTest.php
@@ -169,6 +169,7 @@ public function testConstruction() {
/**
* test that methods dispatch internally and to the engine class
*
+ * @expectedException PHPUnit_Framework_Error_Warning
* @return void
*/
public function testMethodDispatching() {
@@ -182,7 +183,6 @@ public function testMethodDispatching() {
$this->Js->event('click', 'callback');
$this->Js->TestJsEngine = new StdClass();
- $this->expectError();
$this->Js->someMethodThatSurelyDoesntExist();
}
View
2 lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
@@ -2175,6 +2175,7 @@ public function testAjaxLinkGenerationLink() {
/**
* test that mock classes injected into paginatorHelper are called when using link()
*
+ * @expectedException CakeException
* @return void
*/
public function testMockAjaxProviderClassInjection() {
@@ -2196,7 +2197,6 @@ public function testMockAjaxProviderClassInjection() {
$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'));
}

0 comments on commit bfd95d0

Please sign in to comment.