-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nutgram/update_to_4.x
- Loading branch information
Showing
17 changed files
with
354 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Test Suite | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 8.2 ] | ||
|
||
name: PHP ${{ matrix.php }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php }} | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: | | ||
composer update --prefer-dist --no-interaction --no-suggest | ||
- name: Run test suite | ||
run: composer run-script test | ||
coverage: | ||
name: Coverage | ||
needs: [ tests ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
coverage: xdebug | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-8.2-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-8.2 | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-interaction --no-suggest | ||
|
||
- name: Run test suite | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_REPORTER_ID }} | ||
with: | ||
coverageCommand: composer run-script test-coverage | ||
coverageLocations: ${{github.workspace}}/coverage.xml:clover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,46 @@ | |
"name": "nutgram/symfony-bundle", | ||
"description": "Nutgram for Symfony", | ||
"type": "symfony-bundle", | ||
"license": "MIT", | ||
"require": { | ||
"php": "^8.0", | ||
"nutgram/nutgram": "^3.0", | ||
"php": "^8.2", | ||
"nutgram/nutgram": "^4.0", | ||
"symfony/cache": "^6.0", | ||
"symfony/config": "^6.0", | ||
"symfony/http-kernel": "^6.0", | ||
"symfony/dependency-injection": "^6.0", | ||
"symfony/console": "^6.0" | ||
}, | ||
"license": "MIT", | ||
"require-dev": { | ||
"symfony/framework-bundle": "^6.0", | ||
"symfony/yaml": "^6.0", | ||
"pestphp/pest": "^2.6" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"SergiX44\\NutgramBundle\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"SergiX44\\NutgramBundle\\Tests\\": "tests/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Sergio Brighenti", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"scripts": { | ||
"test": "@php vendor/bin/pest --fail-on-warning", | ||
"test-coverage": "@php vendor/bin/pest --coverage --coverage-clover=coverage.xml --fail-on-warning" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
"prefer-stable": true, | ||
"config": { | ||
"allow-plugins": { | ||
"pestphp/pest-plugin": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
<php> | ||
<env name="APP_ENV" value="test"/> | ||
<env name="KERNEL_CLASS" value="SergiX44\NutgramBundle\Tests\Fixtures\AppKernel"/> | ||
<env name="TELEGRAM_TOKEN" value="123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace SergiX44\NutgramBundle\Tests\Fixtures; | ||
|
||
use SergiX44\NutgramBundle\NutgramBundle; | ||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
class AppKernel extends Kernel | ||
{ | ||
|
||
public function registerBundles(): iterable | ||
{ | ||
return [new FrameworkBundle(), new NutgramBundle()]; | ||
} | ||
|
||
public function registerContainerConfiguration(LoaderInterface $loader) | ||
{ | ||
$loader->load(__DIR__.'/test_config.yaml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
framework: | ||
secret: "Three can keep a secret, if two of them are dead." | ||
test: ~ | ||
|
||
nutgram: | ||
token: '%env(string:TELEGRAM_TOKEN)%' | ||
safeMode: false | ||
routes: true | ||
config: | ||
botId: 123 | ||
apiUrl: 'BlaBla' | ||
botName: 'EEE' | ||
testEnv: true | ||
pollingTimeout: 123 | ||
pollingLimit: 456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
use SergiX44\Nutgram\Nutgram; | ||
|
||
it('returns an instance', function () { | ||
/** @var Nutgram $instance */ | ||
$instance = static::getContainer()->get(Nutgram::class); | ||
|
||
expect($instance)->toBeInstanceOf(Nutgram::class); | ||
}); | ||
|
||
it('returns an instance with the alias', function () { | ||
/** @var Nutgram $instance */ | ||
$instance = static::getContainer()->get('nutgram'); | ||
|
||
expect($instance)->toBeInstanceOf(Nutgram::class); | ||
}); |
Oops, something went wrong.