Compare commits

..

4 Commits

Author SHA1 Message Date
Khoubza Younes ff48db2429 run tests on stable versions 2020-12-16 08:58:28 +01:00
Khoubza Younes 669e389677 run tests on stable versions 2020-12-16 08:48:36 +01:00
KHOUBZA Younes a19f4c4da1 update tests 2020-12-15 15:17:00 +01:00
KHOUBZA Younes 7e5116eaed update factories and add tailwindcss template 2020-12-15 15:00:08 +01:00
4 changed files with 14 additions and 10 deletions
+4 -5
View File
@@ -13,7 +13,6 @@ jobs:
fail-fast: true
matrix:
symfony: [5.2.*, 5.1.*, 5.0.*, 4.4.*, 4.3.*, 4.2.*, 4.1.*, 4.0.*, 3.4.*, 3.3.*, 3.2.*, 3.1.*, 3.0.*, 2.8.*, 2.7.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- symfony: 5.2.*
php: 7.2
@@ -75,7 +74,7 @@ jobs:
php: 5.3
phpunit: 4.8.36
name: S${{ matrix.symfony }} - P${{ matrix.php }} - ${{ matrix.dependency-version }}
name: S${{ matrix.symfony }} - P${{ matrix.php }}
steps:
- name: Checkout code
@@ -96,9 +95,9 @@ jobs:
- name: Install dependencies
run: |
COMPOSER_MEMORY_LIMIT=-1 composer require "symfony/symfony:${{ matrix.symfony }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
COMPOSER_MEMORY_LIMIT=-1 composer config extra.symfony.require "${{ matrix.symfony }}"
COMPOSER_MEMORY_LIMIT=-1 composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer require "symfony/symfony:${{ matrix.symfony }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
composer config extra.symfony.require "${{ matrix.symfony }}"
composer update --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
+1 -1
View File
@@ -1,6 +1,6 @@
services:
flasher.toastr:
parent: 'flasher.abstract_factory'
parent: 'flasher.notification_factory'
class: Flasher\Toastr\Prime\ToastrFactory
tags:
- { name: 'flasher.factory', alias: 'toastr' }
+2 -1
View File
@@ -4,7 +4,8 @@ PHPFlasher.addFactory('toastr', (function () {
var exports = {};
exports.render = function (data) {
toastr[data.type](data.message, data.title, data.options);
var notification = data.notification;
toastr[notification.type](notification.message, notification.title, notification.options);
};
exports.renderOptions = function (options) {
@@ -31,10 +31,14 @@ class FlasherToastrExtensionTest extends TestCase
$flasher = $container->getDefinition('flasher');
$calls = $flasher->getMethodCalls();
$this->assertCount(1, $calls);
$this->assertCount(2, $calls);
$this->assertSame('addFactory', $calls[0][0]);
$this->assertSame('toastr', $calls[0][1][0]);
$this->assertSame('flasher.toastr', (string) $calls[0][1][1]);
$this->assertSame('template', $calls[0][1][0]);
$this->assertSame('flasher.notification_factory', (string) $calls[0][1][1]);
$this->assertSame('addFactory', $calls[1][0]);
$this->assertSame('toastr', $calls[1][1][0]);
$this->assertSame('flasher.toastr', (string) $calls[1][1][1]);
}
public function testConfigurationInjectedIntoFlasherConfig()