Files
carpseeds.pl/wp-content/plugins/elementor-3.2.5-bck4/tests/phpunit/elementor/test-utils.php
2024-07-15 11:28:08 +02:00

23 lines
662 B
PHP

<?php
namespace Elementor\Testing;
class Elementor_Test_Utils extends Elementor_Test_Base {
public function test_getYoutubeId() {
$youtube_id = '9uOETcuFjbE';
$youtube_urls = [
'https://www.youtube.com/watch?v=' . $youtube_id,
'https://www.youtube.com/watch?v=' . $youtube_id . '&feature=player_embedded',
'https://youtu.be/' . $youtube_id,
];
foreach ( $youtube_urls as $youtube_url ) {
$video_properties = \Elementor\Embed::get_video_properties( $youtube_url );
$this->assertEquals( $youtube_id, $video_properties['video_id'] );
}
$this->assertNull( \Elementor\Embed::get_video_properties( 'https://www.youtube.com/' ) );
}
}