11<?php
22
3- use Beyondwords \Wordpress \Component \Post \PostMetaUtils ;
4- use Beyondwords \Wordpress \Component \Settings \Fields \IntegrationMethod \IntegrationMethod ;
5- use Beyondwords \Wordpress \Core \CoreUtils ;
3+ use Beyondwords \Wordpress \Core \Player \Renderer \Javascript ;
64use \Symfony \Component \DomCrawler \Crawler ;
75
86/**
97 * Class Javascript.
108 *
119 * Responsible for rendering the JavaScript BeyondWords player.
1210 */
13- class Javascript
11+ class JavascriptTest
1412{
1513 /**
1614 * @test
@@ -21,7 +19,7 @@ public function check()
2119 'post_title ' => 'Javascript::check::1 ' ,
2220 ]);
2321
24- $ this ->assertFalse (Amp:: render ($ post ));
22+ $ this ->assertFalse (Javascript:: check ($ post ));
2523
2624 $ post = self ::factory ()->post ->create_and_get ([
2725 'post_title ' => 'Javascript::check::2 ' ,
@@ -31,37 +29,11 @@ public function check()
3129 ],
3230 ]);
3331
34- $ this ->markTestIncomplete ('This test needs to be updated for AMP rendering . ' );
32+ $ this ->markTestIncomplete ('Needs updates for JavaScript renderer . ' );
3533
36- $ this ->assertTrue (Amp:: render ($ post ));
34+ $ this ->assertTrue (Javascript:: check ($ post ));
3735 }
3836
39- // /**
40- // * @test
41- // */
42- // public static function check(\WP_Post $post): bool
43- // {
44- // if (function_exists('is_preview') && is_preview()) {
45- // return false;
46- // }
47-
48- // if (CoreUtils::isGutenbergPage() || CoreUtils::isEditScreen()) {
49- // return false;
50- // }
51-
52- // $projectId = PostMetaUtils::getProjectId($post->ID);
53-
54- // if (! $projectId) {
55- // return false;
56- // }
57-
58- // $contentId = PostMetaUtils::getContentId($post->ID);
59- // $method = IntegrationMethod::getIntegrationMethod($post);
60-
61- // return $method === IntegrationMethod::CLIENT_SIDE ||
62- // ($method === IntegrationMethod::REST_API && $contentId);
63- // }
64-
6537 /**
6638 * @test
6739 */
0 commit comments