44
55namespace Drupal \drupal_translation_extractor \Test \Unit \Extractor ;
66
7+ use Drupal \drupal_translation_extractor \Test \Unit \AbstractTestCase ;
78use Drupal \drupal_translation_extractor \Translation \Dumper \PoItem ;
89use Drupal \drupal_translation_extractor \Translation \Extractor \PhpExtractor ;
910use Drupal \drupal_translation_extractor \Translation \Extractor \Visitor \TranslatableMarkupVisitor ;
1011use Drupal \drupal_translation_extractor \Translation \Extractor \Visitor \TransMethodVisitor ;
11- use PHPUnit \Framework \TestCase ;
1212use Symfony \Component \Translation \MessageCatalogue ;
1313
14- final class PhpExtractorTest extends TestCase
14+ final class PhpExtractorTest extends AbstractTestCase
1515{
1616 public function testTransMethod (): void
1717 {
@@ -20,7 +20,7 @@ public function testTransMethod(): void
2020 ];
2121 $ extractor = new PhpExtractor ($ visitors );
2222 $ resource = [
23- __DIR__ . ' /resources/ src/MyClass.php ' ,
23+ $ this -> getResourcePath ( ' src/MyClass.php ') ,
2424 ];
2525 $ locale = 'da ' ;
2626 $ messages = new MessageCatalogue ($ locale );
@@ -44,7 +44,7 @@ public function testTransMethodDrupal(): void
4444 ];
4545 $ extractor = new PhpExtractor ($ visitors );
4646 $ resource = [
47- __DIR__ . ' /resources/ src/MyClassDrupal.php ' ,
47+ $ this -> getResourcePath ( ' src/MyClassDrupal.php ') ,
4848 ];
4949 $ locale = 'da ' ;
5050 $ messages = new MessageCatalogue ($ locale );
@@ -67,7 +67,7 @@ public function testTransMethodDrupalModule(): void
6767 new TransMethodVisitor (),
6868 ];
6969 $ extractor = new PhpExtractor ($ visitors );
70- $ resource = __DIR__ . ' /resources/ ' ;
70+ $ resource = $ this -> getResourcePath () ;
7171 $ locale = 'da ' ;
7272 $ messages = new MessageCatalogue ($ locale );
7373 $ extractor ->extract ($ resource , $ messages );
@@ -83,7 +83,7 @@ public function testTranslatableMarkup(): void
8383 new TranslatableMarkupVisitor (),
8484 ];
8585 $ resource = [
86- __DIR__ . ' /resources/ src/MyClass.php ' ,
86+ $ this -> getResourcePath ( ' src/MyClass.php ') ,
8787 ];
8888 $ locale = 'da ' ;
8989
@@ -108,7 +108,7 @@ public function testTranslatableMarkupDrupal(): void
108108 new TranslatableMarkupVisitor (),
109109 ];
110110 $ resource = [
111- __DIR__ . ' /resources/ src/MyClassDrupal.php ' ,
111+ $ this -> getResourcePath ( ' src/MyClassDrupal.php ') ,
112112 ];
113113 $ locale = 'da ' ;
114114
0 commit comments