-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ composer.phar | |
composer.lock | ||
apigen.phar | ||
phpunit.phar | ||
build | ||
build | ||
*.sqlite | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,26 @@ | |
"require": { | ||
"view-components/view-components": "*" | ||
}, | ||
"require-dev": { | ||
"view-components/testing-helpers":"^1.1", | ||
"illuminate/database": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"ViewComponents\\Eloquent\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"ViewComponents\\Eloquent\\Test\\Mock\\": "tests/mock/", | ||
"ViewComponents\\Eloquent\\Test\\": "tests/phpunit/" | ||
} | ||
}, | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"ViewComponents\\Eloquent\\Installer::postComposerInstall" | ||
] | ||
}, | ||
"support": { | ||
"email": "[email protected]", | ||
"source": "https://github.com/view-components/eloquent-data-processing", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="tests/bootstrap.php"> | ||
<testsuites> | ||
<testsuite name="'view-components/eloquent-data-processing' test suite"> | ||
<directory suffix=".php">./tests/phpunit</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
require_once __DIR__ . '/../vendor/view-components/testing-helpers/bootstrap/bootstrap.php'; | ||
use Illuminate\Database\Capsule\Manager as Capsule; | ||
$capsule = new Capsule; | ||
$capsule->addConnection([ | ||
'driver' => 'sqlite', | ||
'database' => __DIR__ . '/../db.sqlite', | ||
'prefix' => '', | ||
]); | ||
$capsule->setAsGlobal(); | ||
$capsule->bootEloquent(); | ||
// set timezone for timestamps etc | ||
date_default_timezone_set('UTC'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace ViewComponents\Eloquent\Test\Mock; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class TestUser extends Model | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace ViewComponents\Eloquent\Test; | ||
|
||
use ViewComponents\Eloquent\EloquentProcessingService; | ||
use ViewComponents\Eloquent\EloquentProcessorResolver; | ||
use ViewComponents\Eloquent\Test\Mock\TestUser; | ||
use ViewComponents\ViewComponents\Data\OperationCollection; | ||
use ViewComponents\ViewComponents\Test\Data\AbstractProcessingServiceTest; | ||
|
||
require __DIR__ .'/../../vendor/view-components/view-components/tests/phpunit/Data/AbstractProcessingServiceTest.php'; | ||
|
||
class DbTableProcessingServiceTest extends AbstractProcessingServiceTest | ||
{ | ||
public function setUp() | ||
{ | ||
$this->data = (new TestUser())->newQuery(); | ||
$this->operations = new OperationCollection(); | ||
$this->service = new EloquentProcessingService( | ||
new EloquentProcessorResolver(), | ||
$this->operations, | ||
$this->data | ||
); | ||
$this->totalCount = (new TestUser())->newQuery()->get()->count(); | ||
} | ||
} |