Skip to content

Commit 3fcb582

Browse files
committed
add travis ci file
1 parent b6d47b6 commit 3fcb582

File tree

4 files changed

+39
-14
lines changed

4 files changed

+39
-14
lines changed

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: php
2+
3+
php:
4+
- 5.6
5+
- 7.0
6+
- 7.1
7+
8+
sudo: false
9+
10+
install: travis_retry composer install --no-interaction --prefer-source
11+
12+
script: vendor/bin/phpunit --verbose

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"require-dev": {
3434
"orchestra/testbench": "~3.4",
35-
"phpunit/phpunit": "^6.2",
35+
"phpunit/phpunit": "^5.7",
3636
"orchestra/database": "~3.4"
3737
}
3838
}

src/Config.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ public static function encryptEmails()
3131
*/
3232
public static function testing()
3333
{
34-
return config('laravel-database-emails.testing.enabled', function () {
34+
$testing = config('laravel-database-emails.testing.enabled', function () {
3535
return function () {
3636
return false;
3737
};
38-
})();
38+
});
39+
40+
return $testing();
3941
}
4042

4143
/**

tests/TestCase.php

+22-11
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ function setUp()
2121
1.0,
2222
'test',
2323
new \stdClass(),
24-
(object) [],
25-
function () {},
24+
(object)[],
25+
function () {
26+
},
2627
];
2728

2829
$this->createSchema();
@@ -86,7 +87,7 @@ protected function schema()
8687
* In a normal app environment these would be added to the 'providers' array in
8788
* the config/app.php file.
8889
*
89-
* @param \Illuminate\Foundation\Application $app
90+
* @param \Illuminate\Foundation\Application $app
9091
*
9192
* @return array
9293
*/
@@ -101,7 +102,7 @@ protected function getPackageProviders($app)
101102
/**
102103
* Define environment setup.
103104
*
104-
* @param \Illuminate\Foundation\Application $app
105+
* @param \Illuminate\Foundation\Application $app
105106
* @return void
106107
*/
107108
protected function getEnvironmentSetUp($app)
@@ -111,14 +112,24 @@ protected function getEnvironmentSetUp($app)
111112

112113
public function createEmail($overwrite = [])
113114
{
115+
$params = array_merge([
116+
'label' => 'welcome',
117+
'recipient' => '[email protected]',
118+
'cc' => null,
119+
'bcc' => null,
120+
'subject' => 'test',
121+
'view' => 'tests::dummy',
122+
'variables' => ['name' => 'John Doe'],
123+
], $overwrite);
124+
114125
return Email::compose()
115-
->label($overwrite['label'] ?? 'welcome')
116-
->recipient($overwrite['recipient'] ?? '[email protected]')
117-
->cc($overwrite['cc'] ?? null)
118-
->bcc($overwrite['bcc'] ?? null)
119-
->subject($overwrite['subject'] ?? 'test')
120-
->view($overwrite['view'] ?? 'tests::dummy')
121-
->variables($overwrite['variables'] ?? ['name' => 'John Doe']);
126+
->label($params['label'])
127+
->recipient($params['recipient'])
128+
->cc($params['cc'])
129+
->bcc($params['bcc'])
130+
->subject($params['subject'])
131+
->view($params['view'])
132+
->variables($params['variables']);
122133
}
123134

124135
public function sendEmail($overwrite = [])

0 commit comments

Comments
 (0)