for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\RedirectBundle\Tests\Functional;
use Zenstruck\RedirectBundle\Tests\Fixture\Bundle\Entity\DummyNotFound;
use Zenstruck\RedirectBundle\Tests\Fixture\Bundle\Entity\DummyRedirect;
/**
* @author Kevin Bond <[email protected]>
*/
class RemoveNotFoundSubscriberTest extends FunctionalTest
{
public function addTestData()
parent::addTestData();
$this->em->persist(new DummyNotFound('/foo', 'http://example.com/foo'));
$this->em->persist(new DummyNotFound('/foo', 'http://example.com/foo?bar=foo'));
$this->em->persist(new DummyNotFound('/bar', 'http://example.com/bar'));
$this->em->flush();
}
* @test
public function delete_not_found_on_create_redirect()
$this->assertCount(3, $this->getNotFounds());
$this->em->persist(new DummyRedirect('/foo', '/bar'));
$this->assertCount(1, $this->getNotFounds());
public function delete_not_found_on_update_redirect()
$redirect = $this->getRedirect('/301-redirect');
$redirect->setSource('/foo');