Skip to content

Commit

Permalink
Merge pull request #10 from ARCANESOFT/develop
Browse files Browse the repository at this point in the history
Recovering PHP 5.6 Support + Organizing the tests
  • Loading branch information
arcanedev-maroc authored Jun 28, 2017
2 parents d9d5838 + 13c40c5 commit a7d2f15
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 2
runs: 3
php_code_sniffer:
enabled: true
config:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: php
sudo: false

php:
- 5.6
- 7.0
- 7.1
- nightly
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=7.0",
"php": ">=5.6.4",
"arcanesoft/auth": "~2.2",
"arcanesoft/core": "~2.4"
},
"require-dev": {
"arcanesoft/foundation": "~2.2",
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0",
"mockery/mockery": "0.9.*"
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0",
"mockery/mockery": "0.9.*"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 3 additions & 1 deletion src/Helpers/ExcludePattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public static function directories(array $patterns)
: $pattern.'/*';
}

return array_unique($patterns);
asort($patterns);

return array_values(array_unique($patterns));
}
}
2 changes: 1 addition & 1 deletion src/Http/Routes/Admin/MediaRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class MediaRoutes extends RouteRegistrar
public function map()
{
$this->get('/', 'MediasController@index')
->name('index'); // media::foundation.index
->name('index'); // admin::media.index
}
}
5 changes: 3 additions & 2 deletions tests/MediaApiTest.php → tests/Feature/MediaApiTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php namespace Arcanesoft\Media\Tests;
<?php namespace Arcanesoft\Media\Tests\Feature;

use Arcanesoft\Media\Tests\Stubs\Models\User;
use Arcanesoft\Media\Tests\TestCase;
use Illuminate\Http\UploadedFile;

/**
* Class MediaApiTest
*
* @package Arcanesoft\Media\Tests
* @package Arcanesoft\Media\Tests\Feature
* @author ARCANEDEV <[email protected]>
*/
class MediaApiTest extends TestCase
Expand Down
50 changes: 50 additions & 0 deletions tests/Unit/Helpers/ExcludePatternTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php namespace Arcanesoft\Media\Tests\Unit\Helpers;

use Arcanesoft\Media\Helpers\ExcludePattern;
use Arcanesoft\Media\Tests\TestCase;

/**
* Class ExcludePatternTest
*
* @package Arcanesoft\Media\Tests\Unit\Helpers
* @author ARCANEDEV <[email protected]>
*/
class ExcludePatternTest extends TestCase
{
/* -----------------------------------------------------------------
| Tests
| -----------------------------------------------------------------
*/

/**
* @test
*
* @dataProvider getPatternsForDirectoriesToExclude
*
* @param array $patterns
* @param array $expected
*/
public function it_can_get_exclude_patterns_for_directories(array $patterns, $expected)
{
$this->assertSame($expected, ExcludePattern::directories($patterns));
}

public function getPatternsForDirectoriesToExclude()
{
return [
[
['folder-1'], ['folder-1', 'folder-1/*'],
],[
['folder-1/*'], ['folder-1', 'folder-1/*'],
],[
['folder-1', 'folder-1/*'], ['folder-1', 'folder-1/*'],
],[
['folder-1/*', 'folder-1'], ['folder-1', 'folder-1/*'],
],[
['folder-1', 'folder-2'], ['folder-1', 'folder-1/*', 'folder-2', 'folder-2/*'],
],[
['folder-2', 'folder-1'], ['folder-1', 'folder-1/*', 'folder-2', 'folder-2/*'],
],
];
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php namespace Arcanesoft\Media\Tests;
<?php namespace Arcanesoft\Media\Tests\Unit;

use Arcanesoft\Media\Tests\TestCase;

/**
* Class MediaServiceProviderTest
*
* @package Arcanesoft\Media\Tests
* @package Arcanesoft\Media\Tests\Unit
* @author ARCANEDEV <[email protected]>
*/
class MediaServiceProviderTest extends TestCase
Expand Down
5 changes: 3 additions & 2 deletions tests/MediaTest.php → tests/Unit/MediaTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php namespace Arcanesoft\Media\Tests;
<?php namespace Arcanesoft\Media\Tests\Unit;

use Arcanesoft\Media\Events;
use Arcanesoft\Media\Tests\TestCase;
use Illuminate\Http\UploadedFile;

/**
* Class MediaTest
*
* @package Arcanesoft\Media\Tests
* @package Arcanesoft\Media\Tests\Unit
* @author ARCANEDEV <[email protected]>
*/
class MediaTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace Arcanesoft\Media\Tests\Providers;
<?php namespace Arcanesoft\Media\Tests\Unit\Providers;

use Arcanesoft\Media\Tests\TestCase;

Expand Down

0 comments on commit a7d2f15

Please sign in to comment.