Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
c7c32659
Commit
c7c32659
authored
Oct 25, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vendor testing support provided.
'swiftmailer' extension unit tests fixed.
parent
2a326c7d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
15 deletions
+50
-15
.travis.yml
.travis.yml
+1
-1
Mailer.php
extensions/swiftmailer/yii/swiftmailer/Mailer.php
+1
-1
Message.php
extensions/swiftmailer/yii/swiftmailer/Message.php
+1
-1
VendorTestCase.php
tests/unit/VendorTestCase.php
+31
-0
MailerTest.php
tests/unit/extensions/swiftmailer/MailerTest.php
+8
-6
MessageTest.php
tests/unit/extensions/swiftmailer/MessageTest.php
+8
-6
No files found.
.travis.yml
View file @
c7c32659
...
...
@@ -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,
swiftmaile
r
-
phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,
vendo
r
after_script
:
-
php vendor/bin/coveralls
extensions/swiftmailer/yii/swiftmailer/Mailer.php
View file @
c7c32659
...
...
@@ -8,7 +8,7 @@
namespace
yii\swiftmailer
;
use
yii\base\InvalidConfigException
;
use
yii\
e
mail\BaseMailer
;
use
yii\mail\BaseMailer
;
/**
* Mailer based on SwiftMailer library.
...
...
extensions/swiftmailer/yii/swiftmailer/Message.php
View file @
c7c32659
...
...
@@ -7,7 +7,7 @@
namespace
yii\swiftmailer
;
use
yii\
e
mail\BaseMessage
;
use
yii\mail\BaseMessage
;
/**
* Email message based on SwiftMailer library.
...
...
tests/unit/VendorTestCase.php
0 → 100644
View file @
c7c32659
<?php
namespace
yiiunit
;
use
yii\base\NotSupportedException
;
use
Yii
;
/**
* This is the base class for all yii framework unit tests, which requires
* external vendor libraries to function.
*/
class
VendorTestCase
extends
TestCase
{
/**
* This method is called before the first test of this test class is run.
* Attempts to load vendor autoloader.
* @throws \yii\base\NotSupportedException
*/
public
static
function
setUpBeforeClass
()
{
$vendorDir
=
__DIR__
.
'/vendor'
;
Yii
::
setAlias
(
'@vendor'
,
$vendorDir
);
$vendorAutoload
=
$vendorDir
.
'/autoload.php'
;
if
(
file_exists
(
$vendorAutoload
))
{
require_once
(
$vendorAutoload
);
}
else
{
throw
new
NotSupportedException
(
"Vendor autoload file '
{
$vendorAutoload
}
' is missing."
);
}
}
}
\ No newline at end of file
tests/unit/extensions/swiftmailer/MailerTest.php
View file @
c7c32659
...
...
@@ -5,20 +5,22 @@ namespace yiiunit\extensions\swiftmailer;
use
Yii
;
use
yii\swiftmailer\Mailer
;
use
yii\swiftmailer\Message
;
use
yiiunit\TestCase
;
use
yiiunit\
Vendor
TestCase
;
/**
* @group vendor
* @group email
* @group swiftmailer
*/
class
MailerTest
extends
TestCase
class
MailerTest
extends
Vendor
TestCase
{
public
function
setUp
()
{
$this
->
mockApplication
(
array
(
'vendorPath'
=>
Yii
::
getAlias
(
'@yiiunit/vendor'
)
));
Yii
::
$app
->
setComponent
(
'email'
,
$this
->
createTestEmailComponent
());
$this
->
mockApplication
([
'components'
=>
[
'email'
=>
$this
->
createTestEmailComponent
()
]
]);
}
/**
...
...
tests/unit/extensions/swiftmailer/MessageTest.php
View file @
c7c32659
...
...
@@ -5,13 +5,14 @@ namespace yiiunit\extensions\swiftmailer;
use
Yii
;
use
yii\swiftmailer\Mailer
;
use
yii\swiftmailer\Message
;
use
yiiunit\TestCase
;
use
yiiunit\
Vendor
TestCase
;
/**
* @group vendor
* @group email
* @group swiftmailer
*/
class
MessageTest
extends
TestCase
class
MessageTest
extends
Vendor
TestCase
{
/**
* @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
()
]
]);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment