diff -u b/tests/Drupal/pgn/Tests/PgnEncoderUnitTest.php b/tests/Drupal/pgn/Tests/PgnEncoderUnitTest.php --- b/tests/Drupal/pgn/Tests/PgnEncoderUnitTest.php +++ b/tests/Drupal/pgn/Tests/PgnEncoderUnitTest.php @@ -17,10 +17,6 @@ protected static $encoder; - protected static $files = array('e4f5Dh5.pgn', 'fools_mate.pgn', 'e4g5Df3f5Dh5.pgn'); - - protected static $pgn_data_files; - /** * {@inheritdoc} */ @@ -44,34 +40,28 @@ /** * @dataProvider testMoveListEncodeProvider */ - public function testMoveListEncode($normalized, $pgn) { + public function testMoveListEncode($normalized, $file) { $encoded = self::$encoder->encode($normalized, 'pgn_move_list'); - $this->assertEquals($pgn, $encoded); + $module_directory_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))); + $this->assertEquals(file_get_contents($module_directory_path . '/tests/' . $file), $encoded); } public function testMoveListEncodeProvider() { - $module_directory_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))); - foreach (self::$files as $file) { - if (!isset(self::$pgn_data_files[$file])) { - self::$pgn_data_files[$file] = file_get_contents($module_directory_path . '/tests/' . $file); - } - } - return array( array( array( 1=> array('e4', 'f5'), 2 => array('Qh5+'), ), - self::$pgn_data_files['e4f5Dh5.pgn'], + 'e4f5Dh5.pgn', ), array( array( 1 => array('f3', 'e5'), 2 => array('g4', 'Dh4#'), ), - self::$pgn_data_files['fools_mate.pgn'], + 'fools_mate.pgn', ), array( array( @@ -79,7 +69,7 @@ 2 => array('Qf3', 'f5'), 3 => array('Qh5#'), ), - self::$pgn_data_files['e4g5Df3f5Dh5.pgn'], + 'e4g5Df3f5Dh5.pgn', ), ); }