Skip to content

Commit

Permalink
Merge pull request #38 from harikt/3x81
Browse files Browse the repository at this point in the history
Remove phpunit from require-dev
  • Loading branch information
koriym authored Jan 28, 2022
2 parents fbe8ee2 + 6d1b17c commit 37859a8
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 105 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Continuous Integration

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
operating-system:
- ubuntu-latest
php-version:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: none
ini-values: assert.exception=1, zend.assertions=1

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

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

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run test suite
run: ./vendor/bin/phpunit
51 changes: 0 additions & 51 deletions .github/workflows/php.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
filter:
paths: ["src/*"]
tools:
external_code_coverage: true
php_code_coverage: true
php_sim: true
php_mess_detector: true
php_pdepend: true
php_analyzer: true
php_cpd: true
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
}
],
"require": {
"php": "^5.6|^7.0"
"php": "^5.6 || ^7.0 || ^8.0"
},
"require-dev": {
"yoast/phpunit-polyfills": "~1.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<phpunit bootstrap="./phpunit.php">
<testsuites>
<testsuite>
<testsuite name="Aura.Intl test suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
Expand Down
4 changes: 3 additions & 1 deletion tests/BasicFormatterTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace Aura\Intl;

class BasicFormatterTest extends \PHPUnit_Framework_TestCase
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class BasicFormatterTest extends TestCase
{
protected function newFormatter()
{
Expand Down
6 changes: 4 additions & 2 deletions tests/FormatterLocatorTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace Aura\Intl;

class FormatterLocatorTest extends \PHPUnit_Framework_TestCase
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class FormatterLocatorTest extends TestCase
{
public function test__constructAndGet()
{
Expand Down Expand Up @@ -31,7 +33,7 @@ public function testSetAndGet()
public function testGet_noSuchFormatter()
{
$formatters = new FormatterLocator;
$this->setExpectedException('Aura\Intl\Exception\FormatterNotMapped');
$this->expectException('Aura\Intl\Exception\FormatterNotMapped');
$formatters->get('noSuchFormatter');
}
}
8 changes: 4 additions & 4 deletions tests/IntlFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ protected function newFormatter()
return new IntlFormatter;
}

public function setUp()
public function set_up()
{
if (! extension_loaded('intl')) {
$this->markTestSkipped('This test is skipped if the Intl Extension is not loaded.');
Expand All @@ -17,7 +17,7 @@ public function setUp()

public function testIntlVersion()
{
$this->setExpectedException('Aura\Intl\Exception\IcuVersionTooLow');
$this->expectException('Aura\Intl\Exception\IcuVersionTooLow');
$formatter = new IntlFormatter('4.7');
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public function testFormat_cannotInstantiateFormatter()
}
}";
$formatter = $this->newFormatter();
$this->setExpectedException('Aura\Intl\Exception\CannotFormat');
$this->expectException('Aura\Intl\Exception\CannotFormat');
$actual = $formatter->format($locale, $string, array('gender' => 'female', 'count' => 5, 'from' => 'Alice', 'to' => 'Bob'));
}

Expand Down Expand Up @@ -174,7 +174,7 @@ public function testEmptyStringThrowsException()
$string = '';
$formatter = $this->newFormatter();
if (! defined('HHVM_VERSION')) {
$this->setExpectedException('Aura\Intl\Exception\CannotInstantiateFormatter');
$this->expectException('Aura\Intl\Exception\CannotInstantiateFormatter');
}
$actual = $formatter->format($locale, $string, []);
if (defined('HHVM_VERSION')) {
Expand Down
10 changes: 6 additions & 4 deletions tests/PackageLocatorTest.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<?php
namespace Aura\Intl;

use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* Test class for Package.
* Generated by PHPUnit on 2012-10-27 at 22:46:01.
*/
class PackageLocatorTest extends \PHPUnit_Framework_TestCase
class PackageLocatorTest extends TestCase
{
protected $packages;

protected function setUp()
protected function set_up()
{
parent::setUp();
parent::set_up();
$this->packages = new PackageLocator([
'Vendor.Foo' => [
'en_US' => function () {
Expand All @@ -32,7 +34,7 @@ public function testGet()
$this->assertSame($first, $again);

// try for an unregistered package
$this->setExpectedException('Aura\Intl\Exception');
$this->expectException('Aura\Intl\Exception');
$this->packages->get('Vendor.Bar', 'en_US');
}
}
8 changes: 5 additions & 3 deletions tests/PackageTest.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<?php
namespace Aura\Intl;

use Yoast\PHPUnitPolyfills\TestCases\TestCase;

/**
* Test class for Package.
* Generated by PHPUnit on 2012-10-27 at 22:46:01.
*/
class PackageTest extends \PHPUnit_Framework_TestCase
class PackageTest extends TestCase
{
protected $package;

protected function setUp()
protected function set_up()
{
parent::setUp();
parent::set_up();
$factory = new PackageFactory;
$this->package = $factory->newInstance([
'fallback' => 'Vendor.Fallback',
Expand Down
4 changes: 3 additions & 1 deletion tests/TranslatorLocatorFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace Aura\Intl;

class TranslatorLocatorFactoryTest extends \PHPUnit_Framework_TestCase
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class TranslatorLocatorFactoryTest extends TestCase
{
public function test__newInstance()
{
Expand Down
28 changes: 15 additions & 13 deletions tests/TranslatorLocatorTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace Aura\Intl;

class TranslatorLocatorTest extends \PHPUnit_Framework_TestCase
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class TranslatorLocatorTest extends TestCase
{
protected $factory;

Expand All @@ -11,7 +13,7 @@ class TranslatorLocatorTest extends \PHPUnit_Framework_TestCase

protected $formatters;

protected function setUp()
protected function set_up()
{
$registry['Vendor.Package']['en_US'] = function () {
return new \Aura\Intl\Package(
Expand Down Expand Up @@ -99,15 +101,15 @@ public function testIssue9()
$this->assertSame($translator->translate('FOO'), $expect);
}

public function testIssue9Failure()
{
$package = new Package;
$package->setMessages([
'FOO' => 'The text for "foo."',
'BAR' => 'The text for "bar."',
]);
// $this->packages->set('Vendor.Package', 'en_UK', $package);
// $this->setExpectedException('Exception');
// $translator = $this->translators->get('Vendor.Package', 'en_UK');
}
// public function testIssue9Failure()
// {
// $package = new Package;
// $package->setMessages([
// 'FOO' => 'The text for "foo."',
// 'BAR' => 'The text for "bar."',
// ]);
// $this->packages->set('Vendor.Package', 'en_UK', $package);
// $this->expectException('Exception');
// $translator = $this->translators->get('Vendor.Package', 'en_UK');
// }
}
6 changes: 4 additions & 2 deletions tests/TranslatorTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace Aura\Intl;

class TranslatorTest extends \PHPUnit_Framework_TestCase
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class TranslatorTest extends TestCase
{
protected $translator;

Expand All @@ -28,7 +30,7 @@ protected function newTranslator(TranslatorInterface $fallback = null)
);
}

protected function setUp()
protected function set_up()
{
$this->factory = new TranslatorFactory;
$this->formatter = new MockFormatter;
Expand Down

0 comments on commit 37859a8

Please sign in to comment.