Skip to content

Commit cff086d

Browse files
authored
Merge pull request phpbb#118 from iMattPro/fix-117
Fix missing revert schema test
2 parents f6c828c + ef7776a commit cff086d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Tests/Tests/epv_test_validate_revert_schema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ protected function isMissingRevertSchema($nodes)
102102
*/
103103
protected function hasMethod($node, $methodName)
104104
{
105-
foreach ($node->stmts as $node)
105+
foreach ($node->stmts as $method)
106106
{
107-
if ($node instanceof ClassMethod && $node->name === $methodName)
107+
if ($method instanceof ClassMethod && $method->name->name === $methodName)
108108
{
109109
return true;
110110
}

tests/validate_revert_schema_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function test_missing_revert_schema()
6363
$this->validateFile('tests/testFiles/migrations/missing_revert_schema.php', function($output)
6464
{
6565
/** @var PHPUnit\Framework\MockObject\MockObject $output */
66-
$output->expects($this->never())
66+
$output->expects($this->once())
6767
->method('addMessage')
6868
->with(OutputInterface::ERROR, 'Migration file tests/testFiles/migrations/missing_revert_schema.php is missing the revert_schema() method.');
6969
});

0 commit comments

Comments
 (0)