Skip to content

Commit

Permalink
✨ Update
Browse files Browse the repository at this point in the history
  • Loading branch information
geekish committed Dec 20, 2020
1 parent 1767c0f commit a5a1c39
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 59 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 7.4]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

17 changes: 5 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@ All Notable changes to `geekish/faker-horse-battery-staple` will be documented i

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 2.0 - 2020-12-20

### Changed
- Switched to successor `fakerphp/faker`.

## 1.0 - 2016-11-14

### Added
- Faker provider using `yuloh/battery-staple`.

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- Nothing

### Security
- Nothing
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
}
],
"require": {
"php": "^5.6|^7.0",
"fzaninotto/faker": "^1.6",
"php": "^7.1|^8.0",
"fakerphp/faker": "^1.9",
"yuloh/battery-staple": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7|^6.0",
"phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.4.2",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
Expand Down
21 changes: 11 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion src/BatteryStapleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
class BatteryStapleProvider extends BaseProvider
{
public function correctHorseBatteryStaple($delimiter = '')
public function correctHorseBatteryStaple($delimiter = ''): string
{
return PasswordGenerator::generate($delimiter);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/BatteryStapleProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BatteryStapleProviderTest extends TestCase
/**
* Set up Faker Generator with BatteryStapleProvider
*/
public function setUp()
protected function setUp(): void
{
$faker = new Generator;
$faker->addProvider(new BatteryStapleProvider($faker));
Expand All @@ -37,6 +37,6 @@ public function testNotEmpty()
public function testGenerateWithDelimiter()
{
$password = $this->faker->correctHorseBatteryStaple('.');
$this->assertRegExp('/((\w+)\.(\w+)\.(\w+)\.(\w+))/', $password);
$this->assertMatchesRegularExpression('/((\w+)\.(\w+)\.(\w+)\.(\w+))/', $password);
}
}

0 comments on commit a5a1c39

Please sign in to comment.