Skip to content

Commit

Permalink
feat: laravel 8 upgrade with test refacts
Browse files Browse the repository at this point in the history
  • Loading branch information
bencsb committed Apr 8, 2021
1 parent a22d5f1 commit a91cf9e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
[![codecov](https://codecov.io/gh/stylers-llc/laravel-address/branch/master/graph/badge.svg)](https://codecov.io/gh/stylers-llc/laravel-address)
[![Maintainability](https://api.codeclimate.com/v1/badges/16913f2a12f13f795cea/maintainability)](https://codeclimate.com/github/stylers-llc/laravel-address/maintainability)

## Requirements
- PHP >= 7.1.3
- Laravel ~5.x
## Laravel version compatibility
| Laravel version | Package version |
|-----------------|-----------------|
| 5.7 | 1.0 |
| 5.8 | 1.1 |
| 6.0 | 1.1 |
| 7.0 | 2.0 |
| 8.0 | 3.0 |

## Installation
```bash
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@
}
],
"require": {
"php": ">=7.2.5",
"illuminate/database": "~7",
"illuminate/support": "~7"
"php": ">=7.3",
"illuminate/database": "~8",
"illuminate/support": "~8",
"laravel/legacy-factories": "^1.1"
},
"require-dev": {
"mockery/mockery": "^1.1",
"orchestra/testbench": "^5.0",
"orchestra/testbench": "^6.0",
"phpmd/phpmd": "^2.6|^2.7|^2.8|^2.9",
"phpunit/phpunit": "^7.3|^8.0|^9.0"
"phpunit/phpunit": "^7.3|^8.0|^9.0",
"illuminate/database": "~8"
},
"autoload": {
"classmap": [
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Models/Traits/HasAddressesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Tests\Unit\Models\Traits;

use Illuminate\Database\Eloquent\ModelNotFoundException;
use Stylers\Address\Enums\AddressTypeEnum;
use Stylers\Address\Models\Address;
use Stylers\Address\Tests\Fixtures\Models\User;
Expand Down Expand Up @@ -170,10 +171,10 @@ public function it_can_delete_when_type_is_null()

/**
* @test
* @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
*/
public function it_can_not_delete()
{
$this->expectException(ModelNotFoundException::class);
$addressable = factory(User::class)->create();
$attributes = factory(Address::class)->make(['type' => AddressTypeEnum::BILLING])->toArray();
$addressable->updateOrCreateAddress($attributes, $attributes['type']);
Expand Down

0 comments on commit a91cf9e

Please sign in to comment.