33namespace Tests \AymDev \CommonMarkBundle \Twig ;
44
55use Aymdev \CommonmarkBundle \Twig \CommonMarkExtension ;
6- use League \CommonMark \CommonMarkConverter ;
6+ use League \CommonMark \MarkdownConverter ;
77use PHPUnit \Framework \TestCase ;
88use Symfony \Component \DependencyInjection \ServiceLocator ;
99
@@ -13,12 +13,16 @@ public function testFilterBasicUsage()
1313 {
1414 $ serviceLocator = new ServiceLocator ([
1515 'a_conv ' => function () {
16- $ converterMockA = $ this ->getMockBuilder (CommonMarkConverter::class)->getMock ();
16+ $ converterMockA = $ this ->getMockBuilder (MarkdownConverter::class)
17+ ->disableOriginalConstructor ()
18+ ->getMock ();
1719 $ converterMockA ->method ('convertToHtml ' )->willReturn ('a ' );
1820 return $ converterMockA ;
1921 },
2022 'b_conv ' => function () {
21- $ converterMockB = $ this ->getMockBuilder (CommonMarkConverter::class)->getMock ();
23+ $ converterMockB = $ this ->getMockBuilder (MarkdownConverter::class)
24+ ->disableOriginalConstructor ()
25+ ->getMock ();
2226 $ converterMockB ->method ('convertToHtml ' )->willReturn ('b ' );
2327 return $ converterMockB ;
2428 },
@@ -37,7 +41,9 @@ public function testFilterConverterNameIsOptional()
3741 {
3842 $ serviceLocator = new ServiceLocator ([
3943 'unique ' => function () {
40- $ converterMock = $ this ->getMockBuilder (CommonMarkConverter::class)->getMock ();
44+ $ converterMock = $ this ->getMockBuilder (MarkdownConverter::class)
45+ ->disableOriginalConstructor ()
46+ ->getMock ();
4147 $ converterMock ->expects (self ::once ())->method ('convertToHtml ' )->willReturnArgument (0 );
4248 return $ converterMock ;
4349 },
@@ -57,7 +63,9 @@ public function testFilterWithInvalidConverterName()
5763 {
5864 $ serviceLocator = new ServiceLocator ([
5965 'my_converter ' => function () {
60- return $ this ->getMockBuilder (CommonMarkConverter::class)->getMock ();
66+ return $ this ->getMockBuilder (MarkdownConverter::class)
67+ ->disableOriginalConstructor ()
68+ ->getMock ();
6169 },
6270 ]);
6371 $ extension = new CommonMarkExtension ($ serviceLocator );
@@ -75,7 +83,9 @@ public function testFilterWithNullContent()
7583 {
7684 $ serviceLocator = new ServiceLocator ([
7785 'my_converter ' => function () {
78- return $ this ->getMockBuilder (CommonMarkConverter::class)->getMock ();
86+ return $ this ->getMockBuilder (MarkdownConverter::class)
87+ ->disableOriginalConstructor ()
88+ ->getMock ();
7989 },
8090 ]);
8191 $ extension = new CommonMarkExtension ($ serviceLocator );
0 commit comments