Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix sample code in testing/controllers #8493

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
michalsn marked this conversation as resolved.
Show resolved Hide resolved

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 ForumControllerTest 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