Skip to content

Commit

Permalink
Added test to reproduce notice from anonymous classes
Browse files Browse the repository at this point in the history
  • Loading branch information
RonRademaker authored and sstalle committed Dec 4, 2015
1 parent 434d4d8 commit ff53cf5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/code/NodeVisitor/PHP4ConstructorVisitorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace code\NodeVisitor;

use PHPUnit_Framework_TestCase;
use Sstalle\php7cc\NodeVisitor\PHP4ConstructorVisitor;

/**
* Unit test for the PHP4 constructor visitor
*
* @author Ron Rademaker
*/
class PHP4ConstructorVisitorTest extends PHPUnit_Framework_TestCase
{
/**
* Test if an anonymous class is dealt with correctly
*/
public function testAnonymousClassIsValid()
{
$visitor = new PHP4ConstructorVisitor();

$node = $this->getMockBuilder('PhpParser\Node\Stmt\Class_')
->disableOriginalConstructor()
->getMock();

// triggers a notice that it shouldn't
$visitor->enterNode($node);

$this->assertTrue(true);
}
}

0 comments on commit ff53cf5

Please sign in to comment.