Skip to content

Commit

Permalink
Merge pull request #79 from agungsugiarto/upgrade-codeigniter
Browse files Browse the repository at this point in the history
upgrade codeigniter to last version
  • Loading branch information
agungsugiarto authored Feb 1, 2021
2 parents 47087c0 + c7c38f6 commit a97e840
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 216 deletions.
55 changes: 24 additions & 31 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
name: boilerplate build
name: "ci build"

on:
push:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- "master"

jobs:
build:

name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest

if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: '7.2'
extension-csv: intl, json, mbstring, mysqlnd. xdebug, xml
coverage: xdebug
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop
- name: Setup MySQL
uses: samin/[email protected]
with:
mysql version: 5.7
mysql password: test
mysql user: test
mysql database: boilerplate-test
- name: Checkout
uses: actions/checkout@v2
- name: "Validate composer.json and composer.lock"
run: "composer validate"
- name: "Install dependencies"
run: "composer install"
- name: "Run test suite"
run: "composer test -- -c phpunit.xml.github-actions.dist"
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
extensions: intl, json, mbstring, xdebug, xml
php-version: "${{ matrix.php-versions }}"
coverage: xdebug
- name: Checkout
uses: actions/checkout@v2
- name: "Validate composer.json and composer.lock"
run: "composer validate"
- name: "Install dependencies"
run: "composer install --prefer-source --no-progress --no-suggest"
- name: "Run test suite"
run: "composer test"
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
}
],
"require": {
"php": ">7.2",
"php": "^7.3 || ^8.0",
"myth/auth": "dev-develop",
"codeigniter4/framework": "^4.1",
"codeigniter4/translations" : "^4.0"
},
"require-dev": {
"codeigniter4/framework": "^4.0",
"phpunit/phpunit": "8.5.*",
"fakerphp/faker": "^1.10"
"phpunit/phpunit": "^9.1",
"fakerphp/faker": "^1.13"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
8 changes: 2 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
<const name="HOMEPATH" value="./"/>
<const name="CONFIGPATH" value="./vendor/codeigniter4/framework/app/Config/"/>
<const name="PUBLICPATH" value="./vendor/codeigniter4/framework/public/"/>
<env name="database.tests.hostname" value="localhost"/>
<env name="database.tests.database" value="boilerplate-test"/>
<env name="database.tests.username" value="root"/>
<env name="database.tests.password" value=""/>
<env name="database.tests.DBDriver" value="MySQLi"/>
<env name="database.tests.DBPrefix" value=""/>
<env name="database.tests.database" value=":memory:"/>
<env name="database.tests.DBDriver" value="SQLite3"/>
</php>
</phpunit>
52 changes: 0 additions & 52 deletions phpunit.xml.github-actions.dist

This file was deleted.

40 changes: 20 additions & 20 deletions tests/Controllers/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

namespace Tests\Controllers;

use App\Controllers\Home;
use CodeIgniter\Test\ControllerTester;
use Tests\Support\AuthTestCase;

class ExampleTest extends AuthTestCase
{
use ControllerTester;
public function testIndexHome()
{
$result = $this->controller(Home::class)
->execute('index');
$this->assertTrue($result->isOK());
}
}
<?php

namespace Tests\Controllers;

use App\Controllers\Home;
use CodeIgniter\Test\ControllerTester;
use Tests\Support\AuthTestCase;

class ExampleTest extends AuthTestCase
{
use ControllerTester;

public function testIndexHome()
{
$result = $this->controller(Home::class)
->execute('index');

$this->assertTrue($result->isOK());
}
}
Loading

0 comments on commit a97e840

Please sign in to comment.