8000 [Notifier][Telegram] Fix dependency · symfony/symfony@1266eae · GitHub
[go: up one dir, main page]

Skip to content

Commit 1266eae

Browse files
committed
[Notifier][Telegram] Fix dependency
The PR * #51717 introduced a new exception in the Notifier component. I tested this locally and faced the following error: ``` Class "Symfony\Component\Notifier\Exception\MultipleExclusiveOptionsUsedException" not found ``` The version bump of the notifier was missing. I also added tests for the exception class.
1 parent c868be4 commit 1266eae

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

src/Symfony/Component/Notifier/Bridge/Telegram/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=8.1",
2020
"symfony/http-client": "^5.4|^6.0|^7.0",
21-
"symfony/notifier": "^6.2.7|^7.0"
21+
"symfony/notifier": "^6.4|^7.0"
2222
},
2323
"autoload": {
2424
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Telegram\\": "" },
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Notifier\Tests\Exception;
13+
14+
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ClassExistsMock;
16+
use Symfony\Component\Notifier\Bridge;
17+
use Symfony\Component\Notifier\Exception\MultipleExclusiveOptionsUsedException;
18+
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
19+
use Symfony\Component\Notifier\Transport\Dsn;
20+
21+
/**
22+
* @runTestsInSeparateProcesses
23+
*
24+
* @see MultipleExclusiveOptionsUsedException
25+
*/
26+
final class MultipleExclusiveOptionsUsedExceptionTest extends TestCase
27+
{
28+
public function testMessageWithoutExclusiveOptionsGiven()
29+
{
30+
$exception = new MultipleExclusiveOptionsUsedException(['foo', 'bar']);
31+
32+
$this->assertSame(
33+
'Multiple exclusive options have been used "foo", "bar".',
34+
$exception->getMessage()
35+
);
36+
}
37+
38+
public function testMessageWithExclusiveOptionsGiven()
39+
{
40+
$exception = new MultipleExclusiveOptionsUsedException(['foo', 'bar'], ['baz', 'qux']);
41+
42+
$this->assertSame(
43+
'Multiple exclusive options have been used "foo", "bar". Only one of "baz", "qux" can be used.',
44+
$exception->getMessage()
45+
);
46+
}
47+
}

0 commit comments

Comments
 (0)
0