File tree Expand file tree Collapse file tree 4 files changed +45
-4
lines changed Expand file tree Collapse file tree 4 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 1
1
language : php
2
2
3
+ services :
4
+ - mysql
5
+
3
6
env :
4
7
global :
5
8
- COVERAGE=0
@@ -25,6 +28,7 @@ matrix:
25
28
26
29
before_script :
27
30
- composer config discard-changes true
31
+ - mysql -e 'create database testing;'
28
32
29
33
before_install :
30
34
- travis_retry composer self-update
@@ -37,7 +41,7 @@ install:
37
41
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest
38
42
39
43
script :
40
- - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
44
+ - vendor/bin/phpunit --configuration=phpunit.travis.xml.dist -- coverage-text --coverage-clover=coverage.clover
41
45
42
46
after_success :
43
47
- if [[ $COVERAGE = 1 ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover report; fi
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <phpunit bootstrap =" vendor/autoload.php"
3
+ backupGlobals =" false"
4
+ backupStaticAttributes =" false"
5
+ colors =" true"
6
+ verbose =" true"
7
+ convertErrorsToExceptions =" true"
8
+ convertNoticesToExceptions =" true"
9
+ convertWarningsToExceptions =" true"
10
+ processIsolation =" false"
11
+ stopOnFailure =" false" >
12
+ <testsuites >
13
+ <testsuite name =" Next Apps Test Suite" >
14
+ <directory >tests</directory >
15
+ </testsuite >
16
+ </testsuites >
17
+ <filter >
18
+ <whitelist >
19
+ <directory suffix =" .php" >src/</directory >
20
+ </whitelist >
21
+ </filter >
22
+ <logging >
23
+ <log type =" tap" target =" build/report.tap" />
24
+ <log type =" junit" target =" build/report.junit.xml" />
25
+ <log type =" coverage-text" target =" build/coverage.txt" />
26
+ <log type =" coverage-clover" target =" build/logs/clover.xml" />
27
+ </logging >
28
+ <php >
29
+ <env name =" DB_CONNECTION" value =" mysql" />
30
+ <env name =" DB_DATABASE" value =" testing" />
31
+ <env name =" DB_USERNAME" value =" root" />
32
+ </php >
33
+ </phpunit >
Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ public static function boot()
63
63
return ;
64
64
}
65
65
66
- VerificationCode::for ($ verificationCode ->verifiable )
66
+ $ oldVerificationCodeIds = VerificationCode::for ($ verificationCode ->verifiable )
67
67
->orderByDesc ('expires_at ' )
68
68
->orderByDesc ('id ' )
69
69
->skip ($ maxCodes )
70
70
->take (PHP_INT_MAX )
71
- ->delete ();
71
+ ->pluck ('id ' );
72
+
73
+ VerificationCode::whereIn ('id ' , $ oldVerificationCodeIds )->delete ();
72
74
});
73
75
}
74
76
Original file line number Diff line number Diff line change 2
2
3
3
namespace NextApps \VerificationCode \Tests ;
4
4
5
+ use Illuminate \Foundation \Testing \DatabaseMigrations ;
5
6
use Illuminate \Foundation \Testing \WithFaker ;
6
7
use Illuminate \Support \Facades \Notification ;
7
8
use NextApps \VerificationCode \VerificationCodeServiceProvider ;
8
9
use Orchestra \Testbench \TestCase as Orchestra ;
9
10
10
11
abstract class TestCase extends Orchestra
11
12
{
12
- use WithFaker;
13
+ use WithFaker,
14
+ DatabaseMigrations;
13
15
14
16
/**
15
17
* Setup the test environment.
You can’t perform that action at this time.
0 commit comments