1 <?php declare(strict_types=1);
5 use PHPUnit\Framework\TestCase;
7 class CommentTest extends TestCase
9 public function testGetSet() {
10 $comment = new Comment('/* Some comment */', 1, 10, 2);
12 $this->assertSame('/* Some comment */', $comment->getText());
13 $this->assertSame('/* Some comment */', (string) $comment);
14 $this->assertSame(1, $comment->getLine());
15 $this->assertSame(10, $comment->getFilePos());
16 $this->assertSame(2, $comment->getTokenPos());
20 * @dataProvider provideTestReformatting
22 public function testReformatting($commentText, $reformattedText) {
23 $comment = new Comment($commentText);
24 $this->assertSame($reformattedText, $comment->getReformattedText());
27 public function provideTestReformatting() {
29 ['// Some text' . "\n", '// Some text'],
30 ['/* Some text */', '/* Some text */'],
67 // invalid comment -> no reformatting