Skip to content

Commit 758b952

Browse files
ChiChi
authored andcommitted
Added test fo generate:other:html-page command.
1 parent ff34d77 commit 758b952

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

src/Tests/Other/HtmlPageTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace DrupalCodeGenerator\Tests\Other;
4+
5+
use DrupalCodeGenerator\Tests\GeneratorTestCase;
6+
use DrupalCodeGenerator\Commands\Other\HtmlPage;
7+
8+
class HtmlPageTest extends GeneratorTestCase {
9+
10+
/**
11+
* {@inheritdoc}
12+
*/
13+
public function setUp () {
14+
$this->command = new HtmlPage();
15+
$this->commandName = 'generate:other:html-page';
16+
$this->answers = [
17+
'example.html',
18+
];
19+
$this->target = 'example.html';
20+
$this->fixture = __DIR__ . '/_' . $this->target;
21+
parent::setUp();
22+
}
23+
24+
}

src/Tests/Other/_example.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<title>Hello world!</title>
7+
<meta name="description" content="">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
10+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
11+
<link rel="stylesheet" href="css/main.css">
12+
</head>
13+
<body>
14+
15+
<div>Hello world!</div>
16+
17+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
18+
<script src="js/main.js"></script>
19+
</body>
20+
</html>

src/Tests/Other/css/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
body{background-color: #EEE}

src/Tests/Other/js/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("It works!")

0 commit comments

Comments
 (0)