diff --git a/.env.example b/.env.example index b012fc3b..4468bcf5 100644 --- a/.env.example +++ b/.env.example @@ -12,7 +12,7 @@ APP_ENV = production WEBPACK_ENV = production # Database Configuration -DB_CONNECTION = dummy +DB_CONNECTION = mysql DB_HOST = localhost DB_PORT = 3306 DB_DATABASE = blessingskin diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..491911c9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: CI + +on: [push] + +jobs: + php73: + name: PHP 7.3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + - name: Run tests + run: | + php -v + mysql -uroot -proot -e 'create database if not exists test;' + ./vendor/bin/phpunit + env: + APP_ENV: testing + frontend: + name: Front End + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: yarn + - name: Run tests + run: | + yarn lint + yarn test diff --git a/app/Services/PluginManager.php b/app/Services/PluginManager.php index 6d90145d..701b1243 100644 --- a/app/Services/PluginManager.php +++ b/app/Services/PluginManager.php @@ -371,7 +371,8 @@ class PluginManager ? [$name => compact('version', 'constraint')] : []; } elseif ($name == 'php') { - $version = PHP_VERSION; + preg_match('/(\d+\.\d+\.\d+)/', PHP_VERSION, $matches); + $version = $matches[1]; return (! Semver::satisfies($version, $constraint)) ? [$name => compact('version', 'constraint')] diff --git a/config/database.php b/config/database.php index 8bb2c5df..5875bc52 100644 --- a/config/database.php +++ b/config/database.php @@ -26,7 +26,7 @@ return [ | */ - 'default' => env('DB_CONNECTION', 'dummy'), + 'default' => env('DB_CONNECTION', 'mysql'), /* |-------------------------------------------------------------------------- diff --git a/tests/ServicesTest/PluginManagerTest.php b/tests/ServicesTest/PluginManagerTest.php index 37558aaa..0c62ec34 100644 --- a/tests/ServicesTest/PluginManagerTest.php +++ b/tests/ServicesTest/PluginManagerTest.php @@ -475,9 +475,11 @@ class PluginManagerTest extends TestCase $this->assertEquals(config('app.version'), $info['version']); $this->assertEquals('^0.0.0', $info['constraint']); + preg_match('/(\d+\.\d+\.\d+)/', PHP_VERSION, $matches); + $version = $matches[1]; $plugin = new Plugin('', ['require' => ['php' => '^0.0.0']]); $info = $manager->getUnsatisfied($plugin)->get('php'); - $this->assertEquals(PHP_VERSION, $info['version']); + $this->assertEquals($version, $info['version']); $this->assertEquals('^0.0.0', $info['constraint']); $plugin = new Plugin('', ['require' => ['another-plugin' => '0.0.*']]); diff --git a/tests/SkinlibControllerTest.php b/tests/SkinlibControllerTest.php index 152f9aaf..d21be01d 100644 --- a/tests/SkinlibControllerTest.php +++ b/tests/SkinlibControllerTest.php @@ -800,6 +800,8 @@ class SkinlibControllerTest extends TestCase // Without returning score option(['return_score' => false, 'private_score_per_storage' => 0]); + $uploader->score += 1000; + $uploader->save(); $texture = factory(Texture::class)->create(['public' => 'false', 'uploader' => $uploader->uid]); $other = factory(User::class)->create(); $other->closet()->attach($texture->tid, ['item_name' => 'a']);