Skip to content

Commit 7b194f7

Browse files
committed
Convert test-crawled-site to PHPUnit
1 parent fdda9be commit 7b194f7

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

integration-tests/test/wp2static_test/crawl_test.clj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
(defn get-crawled-file [path]
77
(slurp (str "wordpress/wp-content/uploads/wp2static-crawled-site/" path)))
88

9-
(deftest test-crawled-site
10-
(test/with-test-system [_]
11-
(test/wp-cli! {} "wp2static" "detect")
12-
(test/wp-cli! {} "wp2static" "crawl")
13-
(is (str/includes? (get-crawled-file "index.html") "Welcome to WordPress"))
14-
(is (str/includes? (get-crawled-file "robots.txt") "Sitemap: http://localhost:7000/wp-sitemap.xml"))))
15-
169
(deftest test-basic-auth
1710
(let [opts {:sh-opts [:env {"HTTP_HOST" "localhost:7002"}]}]
1811
(test/with-test-system [_]

tests/integration/CrawlTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ public function testIndexCrawl(): void
1414
$this->wpCli( [ 'wp2static', 'crawl' ] );
1515

1616
$content = $this->getCrawledFileContents( 'index.html' );
17-
1817
$this->assertStringContainsString( 'Welcome to WordPress', $content );
18+
19+
$content = $this->getCrawledFileContents( 'robots.txt' );
20+
$this->assertStringContainsString(
21+
'Sitemap: http://localhost:8888/wp-sitemap.xml',
22+
$content
23+
);
1924
}
2025
}

0 commit comments

Comments
 (0)