Skip to content

Commit a0d2b96

Browse files
authored
Merge pull request #1042 from cakephp/3.x-uses-to-link
Use link instead of uses to avoid PHPUnit clash.
2 parents 4e25345 + 0c8f2b8 commit a0d2b96

12 files changed

Lines changed: 28 additions & 28 deletions

templates/bake/tests/test_case.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* {{ fullClassName }} Test Case
3636
{% if isController or isCommand %}
3737
*
38-
* @uses \{{ fullClassName }}
38+
* @link \{{ fullClassName }}
3939
{% endif %}
4040
*/
4141
class {{ className }}Test extends TestCase
@@ -123,7 +123,7 @@ class {{ className }}Test extends TestCase
123123
* Test {{ method }} method
124124
*
125125
* @return void
126-
* @uses \{{ fullClassName }}::{{ method }}()
126+
* @link \{{ fullClassName }}::{{ method }}()
127127
*/
128128
public function test{{ method|camelize }}(): void
129129
{

tests/TestCase/Command/AllCommandTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ public function testExecuteWithPrefix()
187187
}
188188

189189
/**
190-
* Test docblock @ uses generated for test methods
190+
* Test docblock @ link generated for test methods
191191
*
192192
* @return void
193193
*/
194-
public function testGenerateUsesDocBlockController()
194+
public function testGenerateLinkDocBlockController()
195195
{
196196
$path = APP;
197197
$testsPath = ROOT . 'tests' . DS;
@@ -213,11 +213,11 @@ public function testGenerateUsesDocBlockController()
213213

214214
$this->assertExitCode(CommandInterface::CODE_SUCCESS);
215215
$this->assertFileContains(
216-
'@uses \Bake\Test\App\Controller\ProductsController::index()',
216+
'@link \Bake\Test\App\Controller\ProductsController::index()',
217217
$testsPath . 'TestCase/Controller/ProductsControllerTest.php',
218218
);
219219
$this->assertFileContains(
220-
'@uses \Bake\Test\App\Model\Table\ProductsTable::validationDefault()',
220+
'@link \Bake\Test\App\Model\Table\ProductsTable::validationDefault()',
221221
$testsPath . 'TestCase/Model/Table/ProductsTableTest.php',
222222
);
223223
$this->assertOutputContains('Bake All complete');

tests/TestCase/Command/CommandCommandTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ public function testGenerateUsesDocBlock()
113113

114114
$this->assertExitCode(CommandInterface::CODE_SUCCESS);
115115
$this->assertFileContains(
116-
'@uses \Bake\Test\App\Command\DocblockCommand::buildOptionParser()',
116+
'@link \Bake\Test\App\Command\DocblockCommand::buildOptionParser()',
117117
$testsPath . 'TestCase/Command/DocblockCommandTest.php',
118118
);
119119
$this->assertFileContains(
120-
'@uses \Bake\Test\App\Command\DocblockCommand::execute()',
120+
'@link \Bake\Test\App\Command\DocblockCommand::execute()',
121121
$testsPath . 'TestCase/Command/DocblockCommandTest.php',
122122
);
123123
}
@@ -142,11 +142,11 @@ public function testGenerateUsesDocBlockPlugin()
142142

143143
$this->assertExitCode(CommandInterface::CODE_SUCCESS);
144144
$this->assertFileContains(
145-
'@uses \BakeTest\Command\DocblockCommand::buildOptionParser()',
145+
'@link \BakeTest\Command\DocblockCommand::buildOptionParser()',
146146
$testsPath . 'TestCase/Command/DocblockCommandTest.php',
147147
);
148148
$this->assertFileContains(
149-
'@uses \BakeTest\Command\DocblockCommand::execute()',
149+
'@link \BakeTest\Command\DocblockCommand::execute()',
150150
$testsPath . 'TestCase/Command/DocblockCommandTest.php',
151151
);
152152
}

tests/TestCase/Command/TestCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ public function testGenerateUsesDocBlockController()
735735

736736
$this->assertExitCode(CommandInterface::CODE_SUCCESS);
737737
$this->assertFileContains(
738-
'@uses \Bake\Test\App\Controller\ProductsController::index()',
738+
'@link \Bake\Test\App\Controller\ProductsController::index()',
739739
$testsPath . 'TestCase/Controller/ProductsControllerTest.php',
740740
);
741741
}
@@ -757,7 +757,7 @@ public function testGenerateUsesDocBlockTable()
757757

758758
$this->assertExitCode(CommandInterface::CODE_SUCCESS);
759759
$this->assertFileContains(
760-
'@uses \Bake\Test\App\Model\Table\ProductsTable::validationDefault()',
760+
'@link \Bake\Test\App\Model\Table\ProductsTable::validationDefault()',
761761
$testsPath . 'TestCase/Model/Table/ProductsTableTest.php',
762762
);
763763
}

tests/comparisons/Test/testBakeCommandHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function tearDown(): void
6363
* Test output method
6464
*
6565
* @return void
66-
* @uses \Bake\Test\App\Command\Helper\ErrorHelper::output()
66+
* @link \Bake\Test\App\Command\Helper\ErrorHelper::output()
6767
*/
6868
public function testOutput(): void
6969
{

tests/comparisons/Test/testBakeCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Bake\Test\App\Command\OtherExampleCommand Test Case
1212
*
13-
* @uses \Bake\Test\App\Command\OtherExampleCommand
13+
* @link \Bake\Test\App\Command\OtherExampleCommand
1414
*/
1515
class OtherExampleCommandTest extends TestCase
1616
{

tests/comparisons/Test/testBakeComponentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function tearDown(): void
4747
* Test startup method
4848
*
4949
* @return void
50-
* @uses \Bake\Test\App\Controller\Component\AppleComponent::startup()
50+
* @link \Bake\Test\App\Controller\Component\AppleComponent::startup()
5151
*/
5252
public function testStartup(): void
5353
{

tests/comparisons/Test/testBakeControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Bake\Test\App\Controller\PostsController Test Case
1212
*
13-
* @uses \Bake\Test\App\Controller\PostsController
13+
* @link \Bake\Test\App\Controller\PostsController
1414
*/
1515
class PostsControllerTest extends TestCase
1616
{
@@ -29,7 +29,7 @@ class PostsControllerTest extends TestCase
2929
* Test index method
3030
*
3131
* @return void
32-
* @uses \Bake\Test\App\Controller\PostsController::index()
32+
* @link \Bake\Test\App\Controller\PostsController::index()
3333
*/
3434
public function testIndex(): void
3535
{

tests/comparisons/Test/testBakeControllerWithoutModelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Bake\Test\App\Controller\NoModelController Test Case
1212
*
13-
* @uses \Bake\Test\App\Controller\NoModelController
13+
* @link \Bake\Test\App\Controller\NoModelController
1414
*/
1515
class NoModelControllerTest extends TestCase
1616
{
@@ -20,7 +20,7 @@ class NoModelControllerTest extends TestCase
2020
* Test index method
2121
*
2222
* @return void
23-
* @uses \Bake\Test\App\Controller\NoModelController::index()
23+
* @link \Bake\Test\App\Controller\NoModelController::index()
2424
*/
2525
public function testIndex(): void
2626
{

tests/comparisons/Test/testBakeModelTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function tearDown(): void
5858
* Test findPublished method
5959
*
6060
* @return void
61-
* @uses \Bake\Test\App\Model\Table\ArticlesTable::findPublished()
61+
* @link \Bake\Test\App\Model\Table\ArticlesTable::findPublished()
6262
*/
6363
public function testFindPublished(): void
6464
{
@@ -69,7 +69,7 @@ public function testFindPublished(): void
6969
* Test doSomething method
7070
*
7171
* @return void
72-
* @uses \Bake\Test\App\Model\Table\ArticlesTable::doSomething()
72+
* @link \Bake\Test\App\Model\Table\ArticlesTable::doSomething()
7373
*/
7474
public function testDoSomething(): void
7575
{
@@ -80,7 +80,7 @@ public function testDoSomething(): void
8080
* Test doSomethingElse method
8181
*
8282
* @return void
83-
* @uses \Bake\Test\App\Model\Table\ArticlesTable::doSomethingElse()
83+
* @link \Bake\Test\App\Model\Table\ArticlesTable::doSomethingElse()
8484
*/
8585
public function testDoSomethingElse(): void
8686
{

0 commit comments

Comments
 (0)