|
| 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
988F
| + '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