Skip to content

Commit

Permalink
Merge pull request #9 from 2amjsouza/master
Browse files Browse the repository at this point in the history
Support php 8.2
  • Loading branch information
tonydspaniard authored Jan 19, 2024
2 parents 787bfe1 + 7a12b28 commit 9800937
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 44 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: tests
on: [push]

jobs:
test:
name: PHPUnit
runs-on: ubuntu-latest

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

- name: setup enviroment
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: Install dependencies
run: composer install

- name: Run unit tests
run: ./vendor/bin/phpunit --coverage-clover ./tests/_output/coverage.xml

#- name: Upload coverage reports to Codacy
# uses: codacy/codacy-coverage-reporter-action@v1
# with:
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# coverage-reports: ./tests/_output/coverage.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ codeception.yml

# composer.lock
composer.lock
/xdebug
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Da\\TwoFA\\Tests\\ServicesTest::testQrCodeDataUriGeneratorService":3,"Da\\TwoFA\\Tests\\ServicesTest::testTOTPSecretKeyUriGeneratorService":1},"times":{"Da\\TwoFA\\Tests\\EncoderTest::testDecodesBase32Strings":0.016,"Da\\TwoFA\\Tests\\EncoderTest::testConvertsInvalidCharsToBase32":0.002,"Da\\TwoFA\\Tests\\EncoderTest::testConvertsToBase32":0.001,"Da\\TwoFA\\Tests\\EncoderTest::testDecodesBase32":0.001,"Da\\TwoFA\\Tests\\EncoderTest::testExceptionWhenIncompatibleGoogleKeyIsGivenToDecodeBase32String":0.005,"Da\\TwoFA\\Tests\\ManagerTest::testIsInitialized":0.002,"Da\\TwoFA\\Tests\\ManagerTest::testGeneratesAValidSecretKey":0.003,"Da\\TwoFA\\Tests\\ManagerTest::testGeneratesAGoogleCompatibleSecretKey":0.001,"Da\\TwoFA\\Tests\\ManagerTest::testCreatesAOneTimePassword":0.001,"Da\\TwoFA\\Tests\\ManagerTest::testVerifiesKeys":0.006,"Da\\TwoFA\\Tests\\ManagerTest::testItVerifiesNewerKeys":0.004,"Da\\TwoFA\\Tests\\ManagerTest::testAttributes":0.001,"Da\\TwoFA\\Tests\\ManagerTest::testInvalidCharactersException":0.002,"Da\\TwoFA\\Tests\\ManagerTest::testFiresInvalidSecretKeyException":0.001,"Da\\TwoFA\\Tests\\ServicesTest::testGoogleQrCodeUrlGeneratorService":0.003,"Da\\TwoFA\\Tests\\ServicesTest::testQrCodeDataUriGeneratorService":1.49,"Da\\TwoFA\\Tests\\ServicesTest::testTOTPSecretKeyUriGeneratorService":0.001}}
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

[![Latest Version](https://img.shields.io/github/tag/2amigos/2fa-library.svg?style=flat-square&label=release)](https://github.com/2amigos/2fa-library/tags)
[![Software License](https://img.shields.io/badge/license-BSD-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/2amigos/2fa-library/master.svg?style=flat-square)](https://travis-ci.org/2amigos/2fa-library)
[![Code Coverage](https://codecov.io/gh/2amigos/2fa-library/branch/master/graph/badge.svg)](https://codecov.io/gh/2amigos/2fa-library)
[![Quality Score](https://img.shields.io/scrutinizer/g/2amigos/2fa-library.svg?style=flat-square)](https://scrutinizer-ci.com/g/2amigos/2fa-library)
[![Build Status](https://img.shields.io/travis/2amigos/2fa-library/master.svg?style=flat-square)](https://travis-ci.org/2amigos/2fa-library) -change
[![Code Coverage](https://codecov.io/gh/2amigos/2fa-library/branch/master/graph/badge.svg)](https://codecov.io/gh/2amigos/2fa-library) -change
[![Quality Score](https://img.shields.io/scrutinizer/g/2amigos/2fa-library.svg?style=flat-square)](https://scrutinizer-ci.com/g/2amigos/2fa-library) -change
[![Total Downloads](https://img.shields.io/packagist/dt/2amigos/2fa-library.svg)](https://packagist.org/packages/2amigos/2fa-library)


Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.3",
"2amigos/qrcode-library": "^2.0",
"php": ">=7.4",
"2amigos/qrcode-library": "^2.0|^3.0",
"paragonie/constant_time_encoding": "^1.4|^2.0|9.99.99",
"paragonie/random_compat": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"friendsofphp/php-cs-fixer": "^2.3",
"scrutinizer/ocular": "~1.1",
"squizlabs/php_codesniffer": "*",
"phpmd/phpmd": "@stable"

"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "^3.7",
"friendsofphp/php-cs-fixer": "^3.45",
"phpmd/phpmd": "@stable",
"psr/container": "^2.0.1|^2.0.2"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
syntaxCheck="true"
verbose="true"
>
<testsuites>
Expand Down
2 changes: 1 addition & 1 deletion tests/EncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EncoderTest extends TestCase
*/
protected $encoder;

protected function setUp()
protected function setUp(): void
{
$this->encoder = new Encoder();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ManagerTest extends TestCase
*/
protected $manager;

protected function setUp()
protected function setUp(): void
{
$this->manager = new Manager();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ServicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ServicesTest extends TestCase
*/
protected $manager;

protected function setUp()
protected function setUp(): void
{
$this->manager = new Manager();
}
Expand All @@ -44,7 +44,7 @@ public function testQrCodeDataUriGeneratorService()
$secret
))->run();

$uri = (new QrCodeDataUriGeneratorService($totp))->run();
$uri = (new QrCodeDataUriGeneratorService($totp, 220))->run();

$this->assertStringEqualsFile(__DIR__ . '/_data/uri.txt', $uri);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/_data/uri.txt

Large diffs are not rendered by default.

0 comments on commit 9800937

Please sign in to comment.