Spaces:
No application file
No application file
File size: 1,035 Bytes
d2897cd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<?php
declare(strict_types=1);
namespace Mautic\PageBundle\Tests\Entity;
use Mautic\PageBundle\Entity\Hit;
use PHPUnit\Framework\Assert;
class HitTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider setUrlTitle
*/
public function testSetUrlTitle(string $urlTitle, int $expected): void
{
$hit = new Hit();
$hit->setUrlTitle($urlTitle);
Assert::assertEquals($expected, mb_strlen($hit->getUrlTitle()));
}
/**
* @return iterable<array<int,int|string>>
*/
public function setUrlTitle(): iterable
{
yield ['custom', 6];
yield ['Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars Title longer than 191 chars ', 191];
}
}
|