-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9dfab49
commit 6bf3a21
Showing
24 changed files
with
354 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Sandbox\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* SandboxProfilesFixture | ||
*/ | ||
class SandboxProfilesFixture extends TestFixture { | ||
|
||
/** | ||
* Init method | ||
* | ||
* @return void | ||
*/ | ||
public function init(): void { | ||
$this->records = [ | ||
[ | ||
'id' => 1, | ||
'username' => 'Lorem ipsum dolor sit amet', | ||
'balance' => 1.5, | ||
'extra' => 1.5, | ||
], | ||
]; | ||
parent::init(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
plugins/Sandbox/tests/TestCase/Controller/DecimalExamplesControllerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Sandbox\Test\TestCase\Controller; | ||
|
||
use Cake\TestSuite\IntegrationTestTrait; | ||
use Cake\TestSuite\TestCase; | ||
|
||
/** | ||
* @uses \Sandbox\Controller\DecimalExamplesController | ||
*/ | ||
class DecimalExamplesControllerTest extends TestCase { | ||
|
||
use IntegrationTestTrait; | ||
|
||
/** | ||
* @var list<string> | ||
*/ | ||
protected array $fixtures = [ | ||
'plugin.Sandbox.SandboxProfiles', | ||
]; | ||
|
||
/** | ||
* @uses \Sandbox\Controller\DecimalExamplesController::index() | ||
* @return void | ||
*/ | ||
public function testIndex(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'DecimalExamples', 'action' => 'index']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\DecimalExamplesController::forms() | ||
* @return void | ||
*/ | ||
public function testForms(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'DecimalExamples', 'action' => 'forms']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\DecimalExamplesController::validation() | ||
* @return void | ||
*/ | ||
public function testValidation(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'DecimalExamples', 'action' => 'validation']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\DecimalExamplesController::api() | ||
* @return void | ||
*/ | ||
public function testApi(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'DecimalExamples', 'action' => 'api']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
} |
77 changes: 77 additions & 0 deletions
77
plugins/Sandbox/tests/TestCase/Controller/FavoriteExamplesControllerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Sandbox\Test\TestCase\Controller; | ||
|
||
use Cake\TestSuite\IntegrationTestTrait; | ||
use Cake\TestSuite\TestCase; | ||
|
||
/** | ||
* @uses \Sandbox\Controller\FavoriteExamplesController | ||
*/ | ||
class FavoriteExamplesControllerTest extends TestCase { | ||
|
||
use IntegrationTestTrait; | ||
|
||
/** | ||
* @var list<string> | ||
*/ | ||
protected array $fixtures = [ | ||
'plugin.Sandbox.SandboxPosts', | ||
'plugin.Sandbox.SandboxUsers', | ||
'plugin.Favorites.Favorites', | ||
]; | ||
|
||
/** | ||
* @uses \Sandbox\Controller\FavoriteExamplesController::index() | ||
* @return void | ||
*/ | ||
public function testIndex(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'FavoriteExamples', 'action' => 'index']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\FavoriteExamplesController::star() | ||
* @return void | ||
*/ | ||
public function testStar(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'FavoriteExamples', 'action' => 'star']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\FavoriteExamplesController::like() | ||
* @return void | ||
*/ | ||
public function testLike(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'FavoriteExamples', 'action' => 'like']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\FavoriteExamplesController::favorite() | ||
* @return void | ||
*/ | ||
public function testFavorite(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'FavoriteExamples', 'action' => 'favorite']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
plugins/Sandbox/tests/TestCase/Controller/LocalizedControllerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Sandbox\Test\TestCase\Controller; | ||
|
||
use Cake\TestSuite\IntegrationTestTrait; | ||
use Cake\TestSuite\TestCase; | ||
|
||
/** | ||
* @uses \Sandbox\Controller\LocalizedController | ||
*/ | ||
class LocalizedControllerTest extends TestCase { | ||
|
||
use IntegrationTestTrait; | ||
|
||
/** | ||
* @uses \Sandbox\Controller\LocalizedController::index() | ||
* @return void | ||
*/ | ||
public function testIndex(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'Localized', 'action' => 'index']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
/** | ||
* @uses \Sandbox\Controller\LocalizedController::basic() | ||
* @return void | ||
*/ | ||
public function testBasic(): void { | ||
$this->disableErrorHandlerMiddleware(); | ||
|
||
$this->get(['plugin' => 'Sandbox', 'controller' => 'Localized', 'action' => 'basic']); | ||
|
||
$this->assertResponseCode(200); | ||
$this->assertNoRedirect(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.