Skip to content

Commit 572f8da

Browse files
committed
Fix the order of creating snapshots
1 parent 0c439da commit 572f8da

22 files changed

+5687
-5687
lines changed

tests/commands/ApiControllerTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ public function testGenerateBootstrap(): void
7575
$filesCount = 0;
7676
$outputPath = Yii::getAlias('@runtime');
7777

78+
$warningsContent = file_get_contents("{$outputPath}/warnings.txt");
79+
// Remove the dynamic parts of the file paths
80+
$warningsContent = preg_replace('/(\s*\[file\] => ).*(\/tests\/.*\.php)/', '$1$2', $warningsContent);
81+
$this->assertMatchesTextSnapshot($warningsContent);
82+
83+
$errorsContent = file_get_contents("{$outputPath}/errors.txt");
84+
// Remove the dynamic parts of the file paths
85+
$errorsContent = preg_replace('/(\s*\[file\] => ).*(\/tests\/.*\.php)/', '$1$2', $errorsContent);
86+
$this->assertMatchesTextSnapshot($errorsContent);
87+
7888
foreach (glob("{$outputPath}/yiiunit-apidoc-data-api*") as $filePath) {
7989
$fileContent = file_get_contents($filePath);
8090

@@ -100,16 +110,6 @@ public function testGenerateBootstrap(): void
100110
$sourceFilesCount = count(FileHelper::findFiles($sourceFilesDir, ['recursive' => true]));
101111

102112
$this->assertSame($sourceFilesCount, $filesCount);
103-
104-
$warningsContent = file_get_contents("{$outputPath}/warnings.txt");
105-
// Remove the dynamic parts of the file paths
106-
$warningsContent = preg_replace('/(\s*\[file\] => ).*(\/tests\/.*\.php)/', '$1$2', $warningsContent);
107-
$this->assertMatchesTextSnapshot($warningsContent);
108-
109-
$errorsContent = file_get_contents("{$outputPath}/errors.txt");
110-
// Remove the dynamic parts of the file paths
111-
$errorsContent = preg_replace('/(\s*\[file\] => ).*(\/tests\/.*\.php)/', '$1$2', $errorsContent);
112-
$this->assertMatchesTextSnapshot($errorsContent);
113113
}
114114

115115
public function testGenerateJson(): void

tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__1.html

Lines changed: 0 additions & 1761 deletions
This file was deleted.

tests/commands/__snapshots__/ApiControllerTest__testGenerateBootstrap__10.html

Lines changed: 15 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212

13-
<title>ActiveQueryInterface, yiiunit\apidoc\data\api\db\ActiveQueryInterface - Yii Framework 2.0 API Documentation</title>
13+
<title>Controller, yiiunit\apidoc\data\api\base\Controller - Yii Framework 2.0 API Documentation</title>
1414
</head>
1515
<body>
1616

@@ -43,16 +43,16 @@
4343
<a class="list-group-item" href="./yiiunit-apidoc-data-api-animal-cat.html">Cat</a>
4444
<a class="list-group-item" href="./yiiunit-apidoc-data-api-animal-dog.html">Dog</a>
4545
</div>
46-
<a class="list-group-item" data-toggle="collapse" data-parent="#navigation">yiiunit\apidoc\data\api\base <b class="caret"></b></a><div class="submenu panel-collapse collapse">
46+
<a class="list-group-item active" data-toggle="collapse" data-parent="#navigation">yiiunit\apidoc\data\api\base <b class="caret"></b></a><div class="submenu panel-collapse collapse in">
4747
<a class="list-group-item" href="./yiiunit-apidoc-data-api-base-action.html">Action</a>
4848
<a class="list-group-item" href="./yiiunit-apidoc-data-api-base-application.html">Application</a>
4949
<a class="list-group-item" href="./yiiunit-apidoc-data-api-base-behavior.html">Behavior</a>
5050
<a class="list-group-item" href="./yiiunit-apidoc-data-api-base-component.html">Component</a>
51-
<a class="list-group-item" href="./yiiunit-apidoc-data-api-base-controller.html">Controller</a>
51+
<a class="list-group-item active" href="./yiiunit-apidoc-data-api-base-controller.html">Controller</a>
5252
</div>
53-
<a class="list-group-item active" data-toggle="collapse" data-parent="#navigation">yiiunit\apidoc\data\api\db <b class="caret"></b></a><div class="submenu panel-collapse collapse in">
53+
<a class="list-group-item" data-toggle="collapse" data-parent="#navigation">yiiunit\apidoc\data\api\db <b class="caret"></b></a><div class="submenu panel-collapse collapse">
5454
<a class="list-group-item" href="./yiiunit-apidoc-data-api-db-activequery.html">ActiveQuery</a>
55-
<a class="list-group-item active" href="./yiiunit-apidoc-data-api-db-activequeryinterface.html">ActiveQueryInterface</a>
55+
<a class="list-group-item" href="./yiiunit-apidoc-data-api-db-activequeryinterface.html">ActiveQueryInterface</a>
5656
<a class="list-group-item" href="./yiiunit-apidoc-data-api-db-activerecord.html">ActiveRecord</a>
5757
<a class="list-group-item" href="./yiiunit-apidoc-data-api-db-activerecordinterface.html">ActiveRecordInterface</a>
5858
<a class="list-group-item" href="./yiiunit-apidoc-data-api-db-activerelationtrait.html">ActiveRelationTrait</a>
@@ -65,25 +65,27 @@
6565
</div>
6666
</div> </div>
6767
<div class="col-md-9 api-content" role="main">
68-
<h1>Interface yiiunit\apidoc\data\api\db\ActiveQueryInterface</h1>
68+
<h1>Class yiiunit\apidoc\data\api\base\Controller</h1>
6969
<div class="top-nav">
7070
<a href="index">All Classes</a>
71-
| <a>Methods</a>
72-
</div>
71+
</div>
7372

7473
<table class="summaryTable docClass table table-bordered">
7574
<colgroup>
7675
<col class="col-name">
7776
<col class="col-value">
7877
</colgroup>
79-
<tr>
80-
<th>Implemented by</th>
81-
<td><a href="yiiunit-apidoc-data-api-db-activequery.html">yiiunit\apidoc\data\api\db\ActiveQuery</a></td>
78+
<tr>
79+
<th>Inheritance</th>
80+
<td>
81+
<a href="yiiunit-apidoc-data-api-base-controller.html">yiiunit\apidoc\data\api\base\Controller</a> &raquo;
82+
<a href="yiiunit-apidoc-data-api-base-component.html">yiiunit\apidoc\data\api\base\Component</a>
83+
</td>
8284
</tr>
83-
</table>
85+
</table>
8486

8587
<div class="class-description">
86-
<p><strong></strong></p>
88+
<p><strong>Controller is the base class for classes containing controller logic.</strong></p>
8789

8890
</div>
8991

@@ -95,132 +97,11 @@ <h1>Interface yiiunit\apidoc\data\api\db\ActiveQueryInterface</h1>
9597

9698
<a></a>
9799

98-
<div class="doc-method summary toggle-target-container">
99-
<h2>Public Methods</h2>
100-
101-
<p><a class="toggle">Hide inherited methods</a></p>
102-
103-
<table class="summary-table table table-striped table-bordered table-hover">
104-
<colgroup>
105-
<col class="col-method">
106-
<col class="col-description">
107-
<col class="col-defined">
108-
</colgroup>
109-
<tr>
110-
<th>Method</th>
111-
<th>Description</th>
112-
<th>Defined By</th>
113-
</tr>
114-
115-
<tr class="">
116-
<td><a href="yiiunit-apidoc-data-api-db-activequeryinterface.html#all()-detail">all()</a></td>
117-
<td></td>
118-
<td><a href="yiiunit-apidoc-data-api-db-activequeryinterface.html">yiiunit\apidoc\data\api\db\ActiveQueryInterface</a></td>
119-
</tr>
120-
<tr class="">
121-
<td><a href="yiiunit-apidoc-data-api-db-activequeryinterface.html#one()-detail">one()</a></td>
122-
<td></td>
123-
<td><a href="yiiunit-apidoc-data-api-db-activequeryinterface.html">yiiunit\apidoc\data\api\db\ActiveQueryInterface</a></td>
124-
</tr>
125-
</table>
126-
</div>
127-
128100
<a></a>
129101

130102
<a></a>
131103

132-
133-
<h2>Method Details</h2>
134-
135-
<div class="method-doc toggle-target-container">
136-
<p><a class="toggle">Hide inherited methods</a></p>
137-
138-
<div class="">
139-
<div class="detail-header h3">
140-
<a class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
141-
<a class="tool-link hash" href="yiiunit-apidoc-data-api-db-activequeryinterface.html#all()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
142-
143-
all()
144-
145-
<span class="detail-header-tag small">
146-
public abstract method
147-
</span>
148-
</div>
149-
150-
151-
<div class="doc-description">
152-
153-
<p><strong></strong></p>
154-
</div>
155-
156-
<table class="detail-table table table-striped table-bordered table-hover">
157-
<tr><td colspan="3" class="signature">
158-
<span class="signature-defs">public abstract</span><span class="signature-type"><a href="https://www.php.net/language.types.mixed">mixed</a></span><strong><a href="yiiunit-apidoc-data-api-db-activequeryinterface.html#all()-detail">all</a></strong> ( )</td></tr>
159-
160-
</table>
161-
162-
163-
164-
165-
<p>
166-
<a class="btn btn-link" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="collapseAll">
167-
Source code
168-
</a>
169-
</p>
170-
<div class="collapse">
171-
<div class="card card-body">
172-
<pre>
173-
<code class="hljs php language-php"><span class="hljs-keyword">public</span><span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-title">all</span><span class="hljs-params">()</span></span>;
174-
</code>
175-
</pre>
176-
</div>
177104
</div>
178-
179-
</div>
180-
<div class="">
181-
<div class="detail-header h3">
182-
<a class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
183-
<a class="tool-link hash" href="yiiunit-apidoc-data-api-db-activequeryinterface.html#one()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
184-
185-
one()
186-
187-
<span class="detail-header-tag small">
188-
public abstract method
189-
</span>
190-
</div>
191-
192-
193-
<div class="doc-description">
194-
195-
<p><strong></strong></p>
196-
</div>
197-
198-
<table class="detail-table table table-striped table-bordered table-hover">
199-
<tr><td colspan="3" class="signature">
200-
<span class="signature-defs">public abstract</span><span class="signature-type"><a href="https://www.php.net/language.types.mixed">mixed</a></span><strong><a href="yiiunit-apidoc-data-api-db-activequeryinterface.html#one()-detail">one</a></strong> ( )</td></tr>
201-
202-
</table>
203-
204-
205-
206-
207-
<p>
208-
<a class="btn btn-link" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="collapseOne">
209-
Source code
210-
</a>
211-
</p>
212-
<div class="collapse">
213-
<div class="card card-body">
214-
<pre>
215-
<code class="hljs php language-php"><span class="hljs-keyword">public</span><span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-title">one</span><span class="hljs-params">()</span></span>;
216-
</code>
217-
</pre>
218-
</div>
219-
</div>
220-
221-
</div>
222-
</div>
223-
</div>
224105
</div>
225106

226107
<script type="text/javascript">

0 commit comments

Comments
 (0)