Browse Source

Fix test.

dereuromark 8 years ago
parent
commit
1d0eb48354
2 changed files with 10 additions and 2 deletions
  1. 6 1
      tests/TestCase/Mailer/EmailTest.php
  2. 4 1
      tests/bootstrap.php

+ 6 - 1
tests/TestCase/Mailer/EmailTest.php

@@ -82,8 +82,13 @@ class EmailTest extends TestCase {
 		$result = $this->Email->from(['cake@cakephp.org' => 'CakePHP']);
 		$this->assertSame($expected, $this->Email->from());
 		$this->assertSame($this->Email, $result);
+	}
 
-		$this->setExpectedException('InvalidArgumentException');
+	/**
+	 * @expectedException \InvalidArgumentException
+	 * @return void
+	 */
+	public function testFromExecption() {
 		$this->Email->from(['cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address']);
 	}
 

+ 4 - 1
tests/bootstrap.php

@@ -1,5 +1,8 @@
 <?php
-define('DS', DIRECTORY_SEPARATOR);
+
+if (!defined('DS')) {
+	define('DS', DIRECTORY_SEPARATOR);
+}
 if (!defined('WINDOWS')) {
 	if (DS == '\\' || substr(PHP_OS, 0, 3) === 'WIN') {
 		define('WINDOWS', true);