forked from timber/timber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-timber-image-multisite.php
39 lines (36 loc) · 1.25 KB
/
test-timber-image-multisite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
class TestTimberImageMultisite extends Timber_UnitTestCase
{
public function tear_down()
{
if (is_multisite()) {
switch_to_blog(1);
}
TestTimberMultisite::clear();
}
public function testSubDomainImageLocaion()
{
if (!is_multisite()) {
$this->markTestSkipped('Test is only for Multisite');
return;
}
$blog_id = TestTimberMultisite::createSubDomainSite();
$this->assertGreaterThan(1, $blog_id);
$pretend_image = 'http://example.org/wp-content/2015/08/fake-pic.jpg';
$is_external = Timber\URLHelper::is_external_content($pretend_image);
$this->assertFalse($is_external);
}
public function testSubDirectoryImageLocaion()
{
if (!is_multisite()) {
$this->markTestSkipped('Test is only for Multisite');
return;
}
$blog_id = TestTimberMultisite::createSubDirectorySite();
$this->assertGreaterThan(1, $blog_id);
$blog_details = get_blog_details($blog_id);
$pretend_image = 'http://example.org/wp-content/2015/08/fake-pic.jpg';
$is_external = Timber\URLHelper::is_external_content($pretend_image);
$this->assertFalse($is_external);
}
}