Skip to content

chore: add language unit tests #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/phpunit-lang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Language Unit Tests

on:
pull_request:
branches:
- develop
paths:
- 'src/Language/**.php'
- '!src/Language/en/**.php'
- 'phpunit*'
- '.github/workflows/phpunit-lang.yml'
push:
branches:
- develop
paths:
- 'src/Language/**.php'
- '!src/Language/en/**.php'
- 'phpunit*'
- '.github/workflows/phpunit-lang.yml'

jobs:
main:
name: Language Unit Tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

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

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: composer, phive, phpunit
extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi

- name: Test with PHPUnit
run: vendor/bin/phpunit --verbose --no-coverage --testsuite lang
env:
TERM: xterm-256color
TACHYCARDIA_MONITOR_GA: enabled
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<directory>./tests</directory>
<exclude>./tests/Language</exclude>
</testsuite>
<testsuite name="language">
<testsuite name="lang">
<directory>./tests/Language</directory>
</testsuite>
</testsuites>
Expand Down
2 changes: 1 addition & 1 deletion src/Language/ja/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

return [
// Exceptions
'unknownAuthenticator' => '{0} は有効なオーセンティケーターではありません。', // '{0} is not a valid authenticator.',
'unknownAuthenticator' => 'xxx{0} は有効なオーセンティケーターではありません。', // '{0} is not a valid authenticator.',
'unknownUserProvider' => '使用するユーザープロバイダーを決定できません。', // 'Unable to determine the User Provider to use.',
'invalidUser' => '指定されたユーザーを見つけることができません。', // 'Unable to locate the specified user.',
'badAttempt' => 'ログインできません。認証情報を確認してください。', // 'Unable to log you in. Please check your credentials.',
Expand Down