Skip to content

Commit 07e017e

Browse files
committed
Fix the tests. Also some cleanup
1 parent 1a550e5 commit 07e017e

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

src/Tests/TestInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function doValidateFile($type);
7272

7373
/**
7474
*
75-
* @return bool
75+
* @return string
7676
*/
7777
public function testName();
7878

src/Tests/Tests/epv_test_validate_linefeeds.php

+1-18
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,12 @@
1111

1212

1313
use Phpbb\Epv\Files\FileInterface;
14-
use Phpbb\Epv\Files\Type\LangFileInterface;
1514
use Phpbb\Epv\Files\Type\PHPFileInterface;
1615
use Phpbb\Epv\Output\Output;
1716
use Phpbb\Epv\Output\OutputInterface;
1817
use Phpbb\Epv\Tests\BaseTest;
1918
use Phpbb\Epv\Tests\Exception\TestException;
2019
use Phpbb\Epv\Tests\Type;
21-
use PHPParser_Error;
22-
use PHPParser_Lexer_Emulative;
23-
use PHPParser_Node;
24-
use PHPParser_Node_Expr_Exit;
25-
use PHPParser_Node_Expr_FuncCall;
26-
use PHPParser_Node_Expr_Print;
27-
use PHPParser_Node_Expr_Variable;
28-
use PHPParser_Node_Stmt_Class;
29-
use PHPParser_Node_Stmt_Echo;
30-
use PHPParser_Node_Stmt_If;
31-
use PHPParser_Node_Stmt_Interface;
32-
use PHPParser_Node_Stmt_Namespace;
33-
use PHPParser_Node_Stmt_Use;
34-
use PHPParser_Parser;
3520

3621

3722
class epv_test_validate_linefeeds extends BaseTest
@@ -49,8 +34,6 @@ public function __construct($debug, OutputInterface $output, $basedir, $namespac
4934
parent::__construct($debug, $output, $basedir, $namespace, $titania, $opendir);
5035

5136
$this->fileTypeFull = Type::TYPE_PHP;
52-
$this->parser = new PHPParser_Parser(new PHPParser_Lexer_Emulative());
53-
$this->totalFileTests = 2;
5437
}
5538

5639
/**
@@ -101,6 +84,6 @@ private function addMessage($type, $message)
10184
*/
10285
public function testName()
10386
{
104-
return 'Validate php structure and deprecated functions';
87+
return 'Validate linefeeds';
10588
}
10689
}

src/Tests/Tests/epv_test_validate_php_functions.php

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public function __construct($debug, OutputInterface $output, $basedir, $namespac
105105

106106
$this->fileTypeFull = Type::TYPE_PHP;
107107
$this->parser = new PHPParser_Parser(new PHPParser_Lexer_Emulative());
108-
$this->totalFileTests = 2;
109108
}
110109

111110
/**

tests/php_exporter_test.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function extension_data()
3333
public function test_event_name($line, $content, $expected_name, $expected_errors = null)
3434
{
3535
$output = new \Phpbb\Epv\Tests\Mock\Output();
36-
$exporter = new \Phpbb\Epv\Events\php_exporter($output);
36+
$exporter = new \Phpbb\Epv\Events\php_exporter($output, '');
3737
$exporter->set_content(file($content));
3838

3939
$name = $exporter->get_event_name($line, false);

0 commit comments

Comments
 (0)