Merge pull request #3003 from stedekay/failing-tests-for-method-annotation

Add failing tests for method annotation
This commit is contained in:
Tomas Votruba 2020-03-04 21:48:45 +01:00 committed by GitHub
commit baa057d48b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<?php
namespace Rector\Symfony\Tests\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector\Fixture;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route;
class ClassWithTemplateAnnotationController
{
/**
* @Route("/show/{id}")
* @Method({"GET", "HEAD"})
* @Template("AdminBundle:Payment:create.html.twig")
*/
public function show($id)
{
}
}
?>
-----
<?php
namespace Rector\Symfony\Tests\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector\Fixture;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route;
class ClassWithTemplateAnnotationController
{
/**
* @Route("/show/{id}", methods={"GET", "HEAD"})
* @Template("AdminBundle:Payment:create.html.twig")
*/
public function show($id)
{
}
}
?>

View File

@ -0,0 +1,42 @@
<?php
namespace Rector\Symfony\Tests\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector\Fixture;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route;
class ClassWithTemplateAnnotation2Controller
{
/**
* @Route("/show/{id}")
* @Template("AdminBundle:Payment:create.html.twig")
* @Method({"GET", "HEAD"})
*/
public function show($id)
{
}
}
?>
-----
<?php
namespace Rector\Symfony\Tests\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector\Fixture;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route;
class ClassWithTemplateAnnotation2Controller
{
/**
* @Route("/show/{id}", methods={"GET", "HEAD"})
* @Template("AdminBundle:Payment:create.html.twig")
*/
public function show($id)
{
}
}
?>