mautic / app /bundles /LeadBundle /Tests /Controller /Api /DeviceApiControllerFunctionalTest.php
chrisbryan17's picture
Upload folder using huggingface_hub
d2897cd verified
<?php
declare(strict_types=1);
namespace Mautic\LeadBundle\Tests\Controller\Api;
use Mautic\CoreBundle\Test\MauticMysqlTestCase;
use Mautic\LeadBundle\Entity\Lead;
use PHPUnit\Framework\Assert;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class DeviceApiControllerFunctionalTest extends MauticMysqlTestCase
{
public function testPutEditWithInexistingIdSoItShouldCreate(): void
{
$contact = new Lead();
$this->em->persist($contact);
$this->em->flush();
$this->client->request(Request::METHOD_PUT, '/api/devices/99999/edit', [
'device' => 'desktop',
'deviceOsName' => 'Ubuntu',
'deviceOsShortName' => 'UBT',
'deviceOsPlatform' => 'x64',
'lead' => $contact->getId(),
]);
$clientResponse = $this->client->getResponse();
Assert::assertSame(Response::HTTP_CREATED, $clientResponse->getStatusCode());
}
}