Skip to content

Commit

Permalink
docs: fix sample code in testing/controllers
Browse files Browse the repository at this point in the history
`namespace CodeIgniter` should not be used in app testing.
  • Loading branch information
kenjis committed Feb 1, 2024
1 parent 02942c4 commit cacdc2c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions user_guide_src/source/testing/controllers/001.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace CodeIgniter;
namespace App\Controllers;

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\ControllerTestTrait;
use CodeIgniter\Test\DatabaseTestTrait;

class TestControllerA extends CIUnitTestCase
class FooControllerTest extends CIUnitTestCase
{
use ControllerTestTrait;
use DatabaseTestTrait;
Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/testing/controllers/002.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

namespace CodeIgniter;
namespace App\Controllers;

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\ControllerTestTrait;
use CodeIgniter\Test\DatabaseTestTrait;

class TestControllerA extends CIUnitTestCase
class FooControllerTest extends CIUnitTestCase
{
use ControllerTestTrait;
use DatabaseTestTrait;

public function testShowCategories()
{
$result = $this->withURI('http://example.com/categories')
->controller(\App\Controllers\ForumController::class)
->controller(ForumController::class)
->execute('showCategories');

$this->assertTrue($result->isOK());
Expand Down
4 changes: 2 additions & 2 deletions user_guide_src/source/testing/controllers/011.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace CodeIgniter;
namespace App\Filters;

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\FilterTestTrait;

class FilterTestCase extends CIUnitTestCase
class FooFilterTest extends CIUnitTestCase
{
use FilterTestTrait;
}
4 changes: 2 additions & 2 deletions user_guide_src/source/testing/controllers/012.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace CodeIgniter;
namespace App\Filters;

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\FilterTestTrait;

final class FilterTestCase extends CIUnitTestCase
final class FooFilterTest extends CIUnitTestCase
{
use FilterTestTrait;

Expand Down
4 changes: 2 additions & 2 deletions user_guide_src/source/testing/controllers/014.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace CodeIgniter;
namespace App\Filters;

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\FilterTestTrait;

final class FilterTestCase extends CIUnitTestCase
final class FooFilterTest extends CIUnitTestCase
{
use FilterTestTrait;

Expand Down

0 comments on commit cacdc2c

Please sign in to comment.