Skip to content

Commit 5048237

Browse files
committed
Update Renderer tests
1 parent c409880 commit 5048237

File tree

3 files changed

+12
-39
lines changed

3 files changed

+12
-39
lines changed

tests/phpunit/Core/Player/ConfigBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use Beyondwords\Wordpress\Component\Settings\Fields\PlayerUI\PlayerUI;
66

77
/**
8-
* Class ConfigBuilder
8+
* Class ConfigBuilderTest
99
*
1010
* Constructs the parameters object for the BeyondWords JS SDK.
1111
*/
12-
class ConfigBuilder
12+
class ConfigBuilderTest
1313
{
1414
/**
1515
* @test

tests/phpunit/Core/Player/Renderer/AmpTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
22

33
use Beyondwords\Wordpress\Core\Environment;
4+
use Beyondwords\Wordpress\Core\Player\Renderer\Amp;
45
use \Symfony\Component\DomCrawler\Crawler;
56

67
/**
78
* Class Amp
89
*
910
* Renders the AMP-compatible BeyondWords player.
1011
*/
11-
class Amp
12+
class AmpTest
1213
{
1314
/**
1415
* @test
@@ -19,7 +20,7 @@ public function check()
1920
'post_title' => 'Amp::check::1',
2021
]);
2122

22-
$this->assertFalse(Amp::render($post));
23+
$this->assertFalse(Amp::check($post));
2324

2425
$post = self::factory()->post->create_and_get([
2526
'post_title' => 'Amp::check::2',
@@ -29,9 +30,9 @@ public function check()
2930
],
3031
]);
3132

32-
$this->markTestIncomplete('This test needs to be updated for AMP rendering.');
33+
$this->markTestIncomplete('Needs updates for Amp renderer.');
3334

34-
$this->assertTrue(Amp::render($post));
35+
$this->assertTrue(Amp::check($post));
3536
}
3637

3738
/**

tests/phpunit/Core/Player/Renderer/JavascriptTest.php

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
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;
64
use \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

Comments
 (0)