Skip to content

Commit c1dda03

Browse files
committed
Split tests with for generated ids
1 parent 1f4d6a8 commit c1dda03

27 files changed

+4652
-28
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"lint": "pint -v",
8484
"types": "phpstan analyse --ansi --memory-limit=2G",
8585
"pest": "pest --colors=always",
86+
"pest-ids": "pest --colors=always --configuration phpunit.ids.xml",
8687
"test:lint": "pint --test -v",
8788
"test:types": "phpstan analyse --ansi",
8889
"test:unit": "pest --colors=always",

phpunit.ids.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
beStrictAboutOutputDuringTests="true"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
failOnRisky="true"
9+
>
10+
<testsuites>
11+
<testsuite name="ID Tests">
12+
<directory suffix="WithId.php">./tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<php>
16+
<env name="DB_CONNECTION" value="testing"/>
17+
<env name="APP_KEY" value="base64:2fl+Ktvkfl+Fuz3Qp/A76G2RTiGVA/ZjKZaz6fiiM10="/>
18+
<env name="APP_ENV" value="testing"/>
19+
<env name="BCRYPT_ROUNDS" value="10"/>
20+
<env name="CACHE_DRIVER" value="array"/>
21+
<env name="MAIL_MAILER" value="array"/>
22+
<env name="QUEUE_CONNECTION" value="sync"/>
23+
<env name="SESSION_DRIVER" value="array"/>
24+
<env name="TELESCOPE_ENABLED" value="false"/>
25+
</php>
26+
<source>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
</source>
31+
</phpunit>

phpunit.xml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
beStrictAboutOutputDuringTests="true"
6-
bootstrap="vendor/autoload.php"
7-
colors="true"
8-
failOnRisky="true"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
beStrictAboutOutputDuringTests="true"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
failOnRisky="true"
99
>
10-
<testsuites>
11-
<testsuite name="Tests">
12-
<directory suffix="Test.php">./tests</directory>
13-
</testsuite>
14-
</testsuites>
15-
<php>
16-
<env name="DB_CONNECTION" value="testing"/>
17-
<env name="APP_KEY" value="base64:2fl+Ktvkfl+Fuz3Qp/A76G2RTiGVA/ZjKZaz6fiiM10="/>
18-
<env name="APP_ENV" value="testing"/>
19-
<env name="BCRYPT_ROUNDS" value="10"/>
20-
<env name="CACHE_DRIVER" value="array"/>
21-
<env name="MAIL_MAILER" value="array"/>
22-
<env name="QUEUE_CONNECTION" value="sync"/>
23-
<env name="SESSION_DRIVER" value="array"/>
24-
<env name="TELESCOPE_ENABLED" value="false"/>
25-
</php>
26-
<source>
27-
<include>
28-
<directory suffix=".php">./src</directory>
29-
</include>
30-
</source>
10+
<testsuites>
11+
<testsuite name="Tests">
12+
<directory suffix="Test.php">./tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<php>
16+
<env name="DB_CONNECTION" value="testing"/>
17+
<env name="APP_KEY" value="base64:2fl+Ktvkfl+Fuz3Qp/A76G2RTiGVA/ZjKZaz6fiiM10="/>
18+
<env name="APP_ENV" value="testing"/>
19+
<env name="BCRYPT_ROUNDS" value="10"/>
20+
<env name="CACHE_DRIVER" value="array"/>
21+
<env name="MAIL_MAILER" value="array"/>
22+
<env name="QUEUE_CONNECTION" value="sync"/>
23+
<env name="SESSION_DRIVER" value="array"/>
24+
<env name="TELESCOPE_ENABLED" value="false"/>
25+
</php>
26+
<source>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
</source>
3131
</phpunit>

tests/Models/HiddenAnimal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @property string $country
1212
* @property bool $can_be_eaten
1313
*/
14-
final class HiddenAnimal extends Model
14+
class HiddenAnimal extends Model
1515
{
1616
protected $connection = 'elasticsearch';
1717

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PDPhilip\Elasticsearch\Tests\Models\IdGenerated;
6+
7+
use PDPhilip\Elasticsearch\Eloquent\GeneratesUuids;
8+
use PDPhilip\Elasticsearch\Tests\Models\Address as Base;
9+
10+
class Address extends Base
11+
{
12+
use GeneratesUuids;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PDPhilip\Elasticsearch\Tests\Models\IdGenerated;
6+
7+
use PDPhilip\Elasticsearch\Eloquent\GeneratesUuids;
8+
use PDPhilip\Elasticsearch\Tests\Models\Client as Base;
9+
10+
class Client extends Base
11+
{
12+
use GeneratesUuids;
13+
}

tests/Models/IdGenerated/Group.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PDPhilip\Elasticsearch\Tests\Models\IdGenerated;
6+
7+
use PDPhilip\Elasticsearch\Eloquent\GeneratesUuids;
8+
use PDPhilip\Elasticsearch\Tests\Models\Group as Base;
9+
10+
class Group extends Base
11+
{
12+
use GeneratesUuids;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PDPhilip\Elasticsearch\Tests\Models\IdGenerated;
6+
7+
use PDPhilip\Elasticsearch\Eloquent\GeneratesUuids;
8+
use PDPhilip\Elasticsearch\Tests\Models\HiddenAnimal as Base;
9+
10+
class HiddenAnimal extends Base
11+
{
12+
use GeneratesUuids;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PDPhilip\Elasticsearch\Tests\Models\IdGenerated;
6+
7+
use PDPhilip\Elasticsearch\Eloquent\GeneratesUuids;
8+
use PDPhilip\Elasticsearch\Tests\Models\Location as Base;
9+
10+
class Location extends Base
11+
{
12+
use GeneratesUuids;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PDPhilip\Elasticsearch\Tests\Models\IdGenerated;
6+
7+
use PDPhilip\Elasticsearch\Eloquent\GeneratesUuids;
8+
use PDPhilip\Elasticsearch\Tests\Models\PageHit as Base;
9+
10+
class PageHit extends Base
11+
{
12+
use GeneratesUuids;
13+
}

0 commit comments

Comments
 (0)