You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff48db2429 | |||
| 669e389677 | |||
| a19f4c4da1 | |||
| 7e5116eaed |
@@ -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,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' }
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user