File tree Expand file tree Collapse file tree 6 files changed +75
-1
lines changed Expand file tree Collapse file tree 6 files changed +75
-1
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ composer.phar
33composer.lock
44apigen.phar
55phpunit.phar
6- build
6+ build
7+ * .sqlite
8+ .env
Original file line number Diff line number Diff line change 2121 "require" : {
2222 "view-components/view-components" : " *"
2323 },
24+ "require-dev" : {
25+ "view-components/testing-helpers" :" ^1.1" ,
26+ "illuminate/database" : " *"
27+ },
2428 "autoload" : {
2529 "psr-4" : {
2630 "ViewComponents\\ Eloquent\\ " : " src/"
2731 }
2832 },
33+ "autoload-dev" : {
34+ "psr-4" : {
35+ "ViewComponents\\ Eloquent\\ Test\\ Mock\\ " : " tests/mock/" ,
36+ "ViewComponents\\ Eloquent\\ Test\\ " : " tests/phpunit/"
37+ }
38+ },
39+ "scripts" : {
40+ "post-install-cmd" : [
41+ " ViewComponents\\ Eloquent\\ Installer::postComposerInstall"
42+ ]
43+ },
2944 "support" : {
3045 "email" : " mail@vitaliy.in" ,
3146 "source" : " https://github.com/view-components/eloquent-data-processing" ,
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit bootstrap =" tests/bootstrap.php" >
3+ <testsuites >
4+ <testsuite name =" 'view-components/eloquent-data-processing' test suite" >
5+ <directory suffix =" .php" >./tests/phpunit</directory >
6+ </testsuite >
7+ </testsuites >
8+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+ require_once __DIR__ . '/../vendor/view-components/testing-helpers/bootstrap/bootstrap.php ' ;
3+ use Illuminate \Database \Capsule \Manager as Capsule ;
4+ $ capsule = new Capsule ;
5+ $ capsule ->addConnection ([
6+ 'driver ' => 'sqlite ' ,
7+ 'database ' => __DIR__ . '/../db.sqlite ' ,
8+ 'prefix ' => '' ,
9+ ]);
10+ $ capsule ->setAsGlobal ();
11+ $ capsule ->bootEloquent ();
12+ // set timezone for timestamps etc
13+ date_default_timezone_set ('UTC ' );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ViewComponents \Eloquent \Test \Mock ;
4+
5+ use Illuminate \Database \Eloquent \Model ;
6+
7+ class TestUser extends Model
8+ {
9+
10+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ViewComponents \Eloquent \Test ;
4+
5+ use ViewComponents \Eloquent \EloquentProcessingService ;
6+ use ViewComponents \Eloquent \EloquentProcessorResolver ;
7+ use ViewComponents \Eloquent \Test \Mock \TestUser ;
8+ use ViewComponents \ViewComponents \Data \OperationCollection ;
9+ use ViewComponents \ViewComponents \Test \Data \AbstractProcessingServiceTest ;
10+
11+ require __DIR__ .'/../../vendor/view-components/view-components/tests/phpunit/Data/AbstractProcessingServiceTest.php ' ;
12+
13+ class DbTableProcessingServiceTest extends AbstractProcessingServiceTest
14+ {
15+ public function setUp ()
16+ {
17+ $ this ->data = (new TestUser ())->newQuery ();
18+ $ this ->operations = new OperationCollection ();
19+ $ this ->service = new EloquentProcessingService (
20+ new EloquentProcessorResolver (),
21+ $ this ->operations ,
22+ $ this ->data
23+ );
24+ $ this ->totalCount = (new TestUser ())->newQuery ()->get ()->count ();
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments