Dan Brown
Committed by GitHub

Updated travis testing to work with new helper configuration (#175)

* Updated travis to call phpunit globally rather then booting application first
...@@ -6,7 +6,6 @@ php: ...@@ -6,7 +6,6 @@ php:
6 6
7 cache: 7 cache:
8 directories: 8 directories:
9 - - vendor
10 - node_modules 9 - node_modules
11 - $HOME/.composer/cache 10 - $HOME/.composer/cache
12 11
...@@ -29,8 +28,10 @@ before_script: ...@@ -29,8 +28,10 @@ before_script:
29 - composer install --prefer-dist --no-interaction 28 - composer install --prefer-dist --no-interaction
30 - npm install 29 - npm install
31 - ./node_modules/.bin/gulp 30 - ./node_modules/.bin/gulp
31 + - php artisan clear-compiled -n
32 + - php artisan optimize -n
32 - php artisan migrate --force -n --database=mysql_testing 33 - php artisan migrate --force -n --database=mysql_testing
33 - php artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing 34 - php artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing
34 35
35 script: 36 script:
36 - - vendor/bin/phpunit
...\ No newline at end of file ...\ No newline at end of file
37 + - phpunit
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,33 +2,31 @@ ...@@ -2,33 +2,31 @@
2 2
3 use BookStack\Ownable; 3 use BookStack\Ownable;
4 4
5 -if (!function_exists('versioned_asset')) { 5 +/**
6 - /** 6 + * Get the path to a versioned file.
7 - * Get the path to a versioned file. 7 + *
8 - * 8 + * @param string $file
9 - * @param string $file 9 + * @return string
10 - * @return string 10 + *
11 - * 11 + * @throws \InvalidArgumentException
12 - * @throws \InvalidArgumentException 12 + */
13 - */ 13 +function versioned_asset($file)
14 - function versioned_asset($file) 14 +{
15 - { 15 + static $manifest = null;
16 - static $manifest = null; 16 +
17 - 17 + if (is_null($manifest)) {
18 - if (is_null($manifest)) { 18 + $manifest = json_decode(file_get_contents(public_path('build/manifest.json')), true);
19 - $manifest = json_decode(file_get_contents(public_path('build/manifest.json')), true); 19 + }
20 - } 20 +
21 - 21 + if (isset($manifest[$file])) {
22 - if (isset($manifest[$file])) { 22 + return baseUrl($manifest[$file]);
23 - return baseUrl($manifest[$file]);
24 - }
25 -
26 - if (file_exists(public_path($file))) {
27 - return baseUrl($file);
28 - }
29 -
30 - throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
31 } 23 }
24 +
25 + if (file_exists(public_path($file))) {
26 + return baseUrl($file);
27 + }
28 +
29 + throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
32 } 30 }
33 31
34 /** 32 /**
......