-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.php
More file actions
31 lines (24 loc) · 850 Bytes
/
Copy pathverify.php
File metadata and controls
31 lines (24 loc) · 850 Bytes
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
<?php
// Smoke test for 01-quickstart. See SUITE.md "01 — quickstart" for the
// required markers this checks.
require __DIR__ . '/../../bootstrap.php';
$dist = inky_example('01-quickstart');
$path = $dist . '/output.html';
if (!is_file($path)) {
fwrite(STDERR, "01-quickstart: missing {$path} — run examples/01-quickstart/run.php first\n");
exit(1);
}
$html = file_get_contents($path);
$failures = 0;
if (!str_contains($html, 'class="button"')) {
fwrite(STDERR, "01-quickstart: expected class=\"button\" in output (transform did not run the button component)\n");
$failures++;
}
if (str_contains($html, '<button')) {
fwrite(STDERR, "01-quickstart: found a bare <button> tag — transform should have replaced it with table markup\n");
$failures++;
}
if ($failures > 0) {
exit(1);
}
echo "01-quickstart: ok\n";