浏览代码

Fix test.

dereuromark 8 年之前
父节点
当前提交
1d0eb48354
共有 2 个文件被更改,包括 10 次插入2 次删除
  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);