Skip to content

Commit

Permalink
Merge pull request #21 from LaraChimp/release/v1.0.0
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
percymamedy authored Oct 22, 2019
2 parents de20c16 + 503298d commit 52f9fde
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 27 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/vendor
/.env
composer.phar
composer.lock
.DS_Store
Thumbs.db
/phpunit.xml
/.idea
/.vscode
.phpunit.result.cache
28 changes: 23 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
dist: xenial
language: php

php:
- 7.1
- 7.2
env:
global:
- SETUP=stable

sudo: false
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.2
env: SETUP=lowest
- php: 7.3
- php: 7.3
env: SETUP=lowest
- php: 7.4snapshot
- php: 7.4snapshot
env: SETUP=lowest

install: travis_retry composer install --no-interaction --prefer-source
cache:
directories:
- $HOME/.composer/cache

install:
- if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
- if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi

script: vendor/bin/phpunit --verbose
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Mango Repo is open-sourced software licensed under the [MIT license](http://open
5.6.x | 0.3.x
5.7.x | 0.3.x
5.8.x | 0.4.x
6.x | 1.x

### Installation
Install Mango Repo as you would with any other dependency managed by Composer:
Expand Down
23 changes: 9 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"name": "larachimp/mango-repo",
"description": "Simple repository package for Laravel 5.",
"keywords": [
"php",
"Laravel5",
"database",
"repository",
"pattern"
],
"description": "Simple repository package for Laravel.",
"keywords": ["php", "Laravel", "database", "repository", "pattern"],
"license": "MIT",
"authors": [
{
Expand All @@ -16,13 +10,14 @@
}
],
"require": {
"php": "^7.1.3",
"illuminate/support": "^5.8",
"larachimp/pine-annotations": "0.2.*"
"php": "^7.2",
"illuminate/support": "^6.0",
"larachimp/pine-annotations": "^1.0"
},
"require-dev": {
"orchestra/testbench": "3.8.*",
"mockery/mockery": "^1.0"
"mockery/mockery": "^1.1",
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0"
},
"autoload": {
"psr-4": {
Expand All @@ -36,7 +31,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.5.x-dev"
"dev-master": "develop"
},
"laravel": {
"providers": [
Expand Down
6 changes: 4 additions & 2 deletions phpunit.xml → phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
syntaxCheck="false"
verbose="true"
>
<testsuites>
<testsuite name="MangoRepo Test Suite">
<directory suffix=".php">./tests/</directory>
<directory suffix=".php">./tests</directory>
</testsuite>
</testsuites>
<php>
Expand Down
4 changes: 3 additions & 1 deletion tests/Fixtures/database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Illuminate\Support\Str;

/*
|--------------------------------------------------------------------------
| Model Factories
Expand All @@ -20,7 +22,7 @@
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
'remember_token' => Str::random(10),
'is_active' => true,
];
});
Expand Down
6 changes: 4 additions & 2 deletions tests/TestRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ public function testUpdateMethod()
/**
* Test the delete method.
*
* @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
* @return void
*/
public function testDeleteMethod()
{
$this->expectException(\Illuminate\Database\Eloquent\ModelNotFoundException::class);

$user1 = factory(User::class)->create([
'name' => 'User 1',
'email' => 'hello@larachimp.com',
Expand Down Expand Up @@ -201,11 +202,12 @@ public function testFindMethod()
/**
* Test the findOrFail method.
*
* @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
* @return void
*/
public function testFindOrFailMethod()
{
$this->expectException(\Illuminate\Database\Eloquent\ModelNotFoundException::class);

$user1 = factory(User::class)->create([
'name' => 'User 1',
'email' => 'hello@larachimp.com',
Expand Down
4 changes: 2 additions & 2 deletions tests/TestRepositoryScopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public function testGlobalScopeOnModelIsAppliedWhenQueringByRepository()
/**
* We will test if an inexistent method is called.
*
* @expectedException \BadMethodCallException
*
* @return void
*/
public function testInExistentScope()
{
$this->expectException(\BadMethodCallException::class);

$foos = $this->app->make(FooRepository::class);
$foos->isNotActive()->get();
}
Expand Down

0 comments on commit 52f9fde

Please sign in to comment.