Skip to content

Commit

Permalink
Added workflow and generate command support.
Browse files Browse the repository at this point in the history
  • Loading branch information
amostajo committed Feb 8, 2023
1 parent 83c8864 commit 555e005
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/tests/ export-ignore
/phpunit.xml export-ignore
.* export-ignore

# Set the line ending configuration
* text=lf
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Testing"

on:
push:
branches: [ v3.0 ]
pull_request:
branches: [ v3.0 ]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
php:
- 7.4
- 8.0
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Cache PHP dependencies
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Tests
run: composer test
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"WPMVC\\": "src/psr4"
}
},
"scripts": {
"test": [
"phpunit"
]
},
"minimum-stability": "dev"
}
10 changes: 6 additions & 4 deletions src/lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

use Ayuco\Listener;
use WPMVC\Resolver;
use WPMVC\Commands\SetupCommand;
use WPMVC\Commands\AddCommand;
use WPMVC\Commands\RegisterCommand;
use WPMVC\Commands\CreateCommand;
use WPMVC\Commands\SetCommand;
use WPMVC\Commands\GenerateCommand;
use WPMVC\Commands\PrettifyCommand;
use WPMVC\Commands\RegisterCommand;
use WPMVC\Commands\SetCommand;
use WPMVC\Commands\SetupCommand;

/**
* CORE WordPress functions.
Expand All @@ -16,7 +17,7 @@
* @copyright 10Quality <http://www.10quality.com>
* @license MIT
* @package WPMVC
* @version 3.1.12
* @version 3.1.18
*/

if ( ! function_exists( 'resize_image' ) ) {
Expand Down Expand Up @@ -113,6 +114,7 @@ function get_ayuco($path)

$ayuco->register(new AddCommand($path));
$ayuco->register(new CreateCommand($path));
$ayuco->register(new GenerateCommand($path));
$ayuco->register(new RegisterCommand($path));
$ayuco->register(new SetCommand($path));
$ayuco->register(new SetupCommand($path));
Expand Down
2 changes: 1 addition & 1 deletion src/psr4/Bridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public function _models()
foreach ( $post->registry_taxonomies as $taxonomy => $args ) {
if ( !isset( $args ) || !is_array( $args ) )
throw new Exception( 'Arguments are missing for taxonomy "'.$taxonomy.'", post type "'.$post->type.'".' );
register_taxonomy( $taxonomy, $post->type, $args );
register_taxonomy( $taxonomy, $post->type, apply_filters( 'wpmvc_taxonomy_args_' . $taxonomy, $args ) );
}
}
}
Expand Down

0 comments on commit 555e005

Please sign in to comment.