Skip to content

Commit f8cdabc

Browse files
committed
fix: #11 confluence space name and page title
1 parent c24e195 commit f8cdabc

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

tests/Feature/WikiImportCommandTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function testHandleConfluenceHtml()
151151
$codingProjectUri = $this->faker->slug;
152152
config(['coding.project_uri' => $codingProjectUri]);
153153

154-
$path = $this->dataDir . 'confluence/space-1/';
154+
$path = $this->dataDir . 'confluence/space1/';
155155

156156
$codingResponse = $this->codingResponse;
157157
$this->mock(Coding::class, function (MockInterface $mock) use (
@@ -166,13 +166,13 @@ public function testHandleConfluenceHtml()
166166
->expectsQuestion('数据来源?', 'Confluence')
167167
->expectsQuestion('数据类型?', 'HTML')
168168
->expectsQuestion('路径:', $path)
169-
->expectsOutput('空间名称:Demo')
170-
->expectsOutput('空间标识:demo')
169+
->expectsOutput('空间名称:空间 1')
170+
->expectsOutput('空间标识:space1')
171171
->expectsOutput('发现 2 个一级页面')
172172
->expectsOutput("开始导入 CODING:")
173173
->expectsOutput('标题:Image Demo')
174174
->expectsOutput("https://${codingTeamDomain}.coding.net/p/$codingProjectUri/wiki/27")
175-
->expectsOutput('标题:Demo')
175+
->expectsOutput('标题:你好世界')
176176
->expectsOutput("https://${codingTeamDomain}.coding.net/p/$codingProjectUri/wiki/27")
177177
->assertExitCode(0);
178178
}

tests/Unit/ConfluenceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ConfluenceTest extends TestCase
1010
public function testParsePageHtml()
1111
{
1212
$confluence = new Confluence();
13-
$result = $confluence->parsePageHtml($this->dataDir . 'confluence/space-1/text-demo_65601.html', 'Demo');
13+
$result = $confluence->parsePageHtml($this->dataDir . 'confluence/space1/text-demo_65601.html', '空间 1');
1414
$this->assertEquals([
1515
'title' => 'Text Demo',
1616
'content' => '你好',

tests/data/confluence/space-1/demo_65591.html renamed to tests/data/confluence/space1/65591.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Demo : Demo</title>
4+
<title>空间 1 : 你好世界</title>
55
<link rel="stylesheet" href="styles/site.css" type="text/css"/>
66
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
77
</head>
@@ -21,7 +21,7 @@ <h1 id="title-heading" class="pagetitle">
2121
<img src="images/icons/contenttypes/home_page_16.png" height="16" width="16" border="0"
2222
align="absmiddle" alt="Home Page" style="float: none; vertical-align: middle;"/>
2323
<span id="title-text">
24-
Demo : Demo
24+
空间 1 : 你好世界
2525
</span>
2626
</h1>
2727
</div>

tests/data/confluence/space-1/attachment-demo_65615.html renamed to tests/data/confluence/space1/attachment-demo_65615.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Demo : Attachment Demo</title>
4+
<title>空间 1 : Attachment Demo</title>
55
<link rel="stylesheet" href="styles/site.css" type="text/css"/>
66
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
77
</head>
@@ -16,13 +16,13 @@
1616
<span><a href="index.html">Demo</a></span>
1717
</li>
1818
<li>
19-
<span><a href="demo_65591.html">Demo</a></span>
19+
<span><a href="65591.html">Demo</a></span>
2020
</li>
2121
</ol>
2222
</div>
2323
<h1 id="title-heading" class="pagetitle">
2424
<span id="title-text">
25-
Demo : Attachment Demo
25+
空间 1 : Attachment Demo
2626
</span>
2727
</h1>
2828
</div>

tests/data/confluence/space-1/image-demo_65619.html renamed to tests/data/confluence/space1/image-demo_65619.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Demo : Image Demo</title>
4+
<title>空间 1 : Image Demo</title>
55
<link rel="stylesheet" href="styles/site.css" type="text/css"/>
66
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
77
</head>
@@ -16,13 +16,13 @@
1616
<span><a href="index.html">Demo</a></span>
1717
</li>
1818
<li>
19-
<span><a href="demo_65591.html">Demo</a></span>
19+
<span><a href="65591.html">Demo</a></span>
2020
</li>
2121
</ol>
2222
</div>
2323
<h1 id="title-heading" class="pagetitle">
2424
<span id="title-text">
25-
Demo : Image Demo
25+
空间 1 : Image Demo
2626
</span>
2727
</h1>
2828
</div>

tests/data/confluence/space-1/index.html renamed to tests/data/confluence/space1/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>demo(Demo)</title>
4+
<title>space1 (空间 1)</title>
55
<link rel="stylesheet" href="styles/site.css" type="text/css"/>
66
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
77
</head>
@@ -20,11 +20,11 @@ <h1 id="title-heading" class="pagetitle">
2020
<table class="confluenceTable">
2121
<tr>
2222
<th class="confluenceTh">Key</th>
23-
<td class="confluenceTd">demo</td>
23+
<td class="confluenceTd">space1</td>
2424
</tr>
2525
<tr>
2626
<th class="confluenceTh">Name</th>
27-
<td class="confluenceTd">Demo</td>
27+
<td class="confluenceTd">空间 1</td>
2828
</tr>
2929
<tr>
3030
<th class="confluenceTh">Description</th>
@@ -49,7 +49,7 @@ <h2 class="pageSectionTitle">Available Pages:</h2>
4949

5050
</li>
5151
<li>
52-
<a href="demo_65591.html">Demo</a>
52+
<a href="65591.html">你好世界</a>
5353

5454
<img src="images/icons/contenttypes/home_page_16.png" height="16" width="16" border="0"
5555
align="absmiddle"/>

tests/data/confluence/space-1/text-demo_65601.html renamed to tests/data/confluence/space1/text-demo_65601.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Demo : Text Demo</title>
4+
<title>空间 1 : Text Demo</title>
55
<link rel="stylesheet" href="styles/site.css" type="text/css"/>
66
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
77
</head>
@@ -19,7 +19,7 @@
1919
</div>
2020
<h1 id="title-heading" class="pagetitle">
2121
<span id="title-text">
22-
Demo : Text Demo
22+
空间 1 : Text Demo
2323
</span>
2424
</h1>
2525
</div>

0 commit comments

Comments
 (0)