diff --git a/.travis.yml b/.travis.yml index 0218654..99ff95a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - tests/unit/data/travis/cubrid-setup.sh script: - - phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,swiftmailer + - phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,vendor after_script: - php vendor/bin/coveralls diff --git a/extensions/swiftmailer/yii/swiftmailer/Mailer.php b/extensions/swiftmailer/yii/swiftmailer/Mailer.php index 2f8bbe7..1d5bc5c 100644 --- a/extensions/swiftmailer/yii/swiftmailer/Mailer.php +++ b/extensions/swiftmailer/yii/swiftmailer/Mailer.php @@ -8,7 +8,7 @@ namespace yii\swiftmailer; use yii\base\InvalidConfigException; -use yii\email\BaseMailer; +use yii\mail\BaseMailer; /** * Mailer based on SwiftMailer library. diff --git a/extensions/swiftmailer/yii/swiftmailer/Message.php b/extensions/swiftmailer/yii/swiftmailer/Message.php index e850208..7cf3032 100644 --- a/extensions/swiftmailer/yii/swiftmailer/Message.php +++ b/extensions/swiftmailer/yii/swiftmailer/Message.php @@ -7,7 +7,7 @@ namespace yii\swiftmailer; -use yii\email\BaseMessage; +use yii\mail\BaseMessage; /** * Email message based on SwiftMailer library. diff --git a/tests/unit/VendorTestCase.php b/tests/unit/VendorTestCase.php new file mode 100644 index 0000000..d633d02 --- /dev/null +++ b/tests/unit/VendorTestCase.php @@ -0,0 +1,30 @@ +mockApplication(array( - 'vendorPath' => Yii::getAlias('@yiiunit/vendor') - )); - Yii::$app->setComponent('email', $this->createTestEmailComponent()); + $this->mockApplication([ + 'components' => [ + 'email' => $this->createTestEmailComponent() + ] + ]); } /** diff --git a/tests/unit/extensions/swiftmailer/MessageTest.php b/tests/unit/extensions/swiftmailer/MessageTest.php index cabf22a..530d725 100644 --- a/tests/unit/extensions/swiftmailer/MessageTest.php +++ b/tests/unit/extensions/swiftmailer/MessageTest.php @@ -5,13 +5,14 @@ namespace yiiunit\extensions\swiftmailer; use Yii; use yii\swiftmailer\Mailer; use yii\swiftmailer\Message; -use yiiunit\TestCase; +use yiiunit\VendorTestCase; /** + * @group vendor * @group email * @group swiftmailer */ -class MessageTest extends TestCase +class MessageTest extends VendorTestCase { /** * @var string test email address, which will be used as receiver for the messages. @@ -20,10 +21,11 @@ class MessageTest extends TestCase public function setUp() { - $this->mockApplication(array( - 'vendorPath' => Yii::getAlias('@yiiunit/vendor') - )); - Yii::$app->setComponent('email', $this->createTestEmailComponent()); + $this->mockApplication([ + 'components' => [ + 'email' => $this->createTestEmailComponent() + ] + ]); } /**