Skip to content

Commit

Permalink
Merge pull request #8 from stylers-llc/release/5.0
Browse files Browse the repository at this point in the history
build: update Laravel version from v9 to v10
  • Loading branch information
t1k3 authored Jan 3, 2024
2 parents 03c0ea1 + ff95aa1 commit 6bc73bf
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 60 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
build
vendor
composer.lock
.phpunit.result.cache
.phpunit.result.cache
.phpunit.cache
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
| 7.0 | 2.0 |
| 8.0 | 3.0 |
| 9.0 | 4.0 |
| 10.0 | 5.0 |

## Installation
```bash
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
}
],
"require": {
"php": ">=8.0",
"illuminate/database": "~9",
"illuminate/support": "~9",
"php": ">=8.1",
"illuminate/database": "~10",
"illuminate/support": "~10",
"laravel/legacy-factories": "^1.3.2"
},
"require-dev": {
"mockery/mockery": "^1.6",
"orchestra/testbench": "^7.0",
"orchestra/testbench": "^8.0",
"phpmd/phpmd": "^2.6|^2.7|^2.8|^2.9|^2.15",
"phpunit/phpunit": "^7.3|^8.0|^9.0|^10",
"illuminate/database": "~9"
"illuminate/database": "~10"
},
"autoload": {
"classmap": [
Expand Down
57 changes: 26 additions & 31 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix=".php">tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="build/phpunit/html"/>
<log type="coverage-clover" target="build/phpunit/clover.xml"/>
<log type="coverage-text" target="build/phpunit/coverage.txt"/>
</logging>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<report>
<clover outputFile="build/phpunit/clover.xml"/>
<html outputDirectory="build/phpunit/html"/>
<text outputFile="build/phpunit/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix=".php">tests/Unit</directory>
</testsuite>
</testsuites>
<logging/>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
15 changes: 3 additions & 12 deletions tests/Unit/Models/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,17 @@

class AddressTest extends TestCase
{
public function dataProvider()
{
return [
[User::class],
];
}

/**
* @dataProvider dataProvider
* @test
* @param string $class
*/
public function get_addressable_relation(string $class)
public function get_addressable_relation()
{
$addressable = factory($class)->create();
$addressable = factory(User::class)->create();
$address = factory(Address::class)->make();
$address->addressable()->associate($addressable);
$address->save();
$address->refresh();

$this->assertEquals($class, get_class($address->addressable));
$this->assertEquals(User::class, get_class($address->addressable));
}
}
13 changes: 2 additions & 11 deletions tests/Unit/Models/Traits/HasAddressesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,13 @@

class HasAddressesTest extends TestCase
{
public function dataProvider()
{
return [
[User::class],
];
}

/**
* @test
* @dataProvider dataProvider
* @param string $class
*/
public function get_addresses_relation(string $class)
public function get_addresses_relation()
{
$address = factory(Address::class)->make();
$addressable = factory($class)->create();
$addressable = factory(User::class)->create();
$addressable->addresses()->save($address);
$addressable->refresh();
$attachedAddress = $addressable->addresses()->first();
Expand Down

0 comments on commit 6bc73bf

Please sign in to comment.