Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #693 from teiling88/misc/give-me-more-tests
Misc/give me more tests
- Loading branch information
Showing
14 changed files
with
126 additions
and
108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace OcTest\Modules\Api; | ||
|
||
use OcTest\Modules\AbstractModuleTest; | ||
|
||
require_once __DIR__ . '/../../../htdocs/api/rot13.php'; | ||
|
||
class Rot13Test extends AbstractModuleTest | ||
{ | ||
// this function didn't support nested braces | ||
public function test_hint_rot13_excludes_braces() | ||
{ | ||
$string = 'a[123123]b'; | ||
|
||
self::assertEquals('n[123123]o', \hint_rot13($string)); | ||
|
||
$string = 'a[abcdef]b'; | ||
|
||
self::assertEquals('n[abcdef]o', \hint_rot13($string)); | ||
|
||
$string = 'abcdefghijklmnopqrstuvwxyz'; | ||
self::assertEquals('nopqrstuvwxyzabcdefghijklm', \hint_rot13($string)); | ||
|
||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||
self::assertEquals('NOPQRSTUVWXYZABCDEFGHIJKLM', \hint_rot13($string)); | ||
} | ||
|
||
public function test_hint_rot13_encrypts() | ||
{ | ||
$string = 'abcd123efgh'; | ||
|
||
self::assertEquals('nopq123rstu', \hint_rot13($string)); | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
tests/Modules/Oc/GeoCache/Controller/QrCodeControllerTest.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,23 @@ | ||
<?php | ||
|
||
namespace OcTest\Modules\Oc\GeoCache\Controller; | ||
|
||
use AppKernel; | ||
use Oc\GeoCache\Controller\QrCodeController; | ||
use OcTest\Modules\TestCase; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class QrCodeControllerTest extends TestCase | ||
{ | ||
public function test_generate_qr_code_throws_unkown_waypoint_exception() | ||
{ | ||
/** @var QrCodeController $controller */ | ||
$controller = AppKernel::Container()->get(QrCodeController::class); | ||
|
||
$request = new Request(['wp' => 'OC0002']); | ||
|
||
$this->setExpectedException(\InvalidArgumentException::class); | ||
|
||
$controller->generateQrCode($request); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/Modules/OcDev/KitchenSink/Subscriber/MenuSubscriberTest.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,20 @@ | ||
<?php | ||
|
||
namespace OcTest\Modules\OcDev\KitchenSink\Subscriber; | ||
|
||
use AppKernel; | ||
use OcDev\KitchenSink\Subscriber\MenuSubscriber; | ||
use OcTest\Modules\TestCase; | ||
|
||
/** | ||
* Class CountryEntityTest | ||
*/ | ||
class MenuSubscriberTest extends TestCase | ||
{ | ||
public function test_get_subscribed_events_returns_array() | ||
{ | ||
$menuSubscriber = AppKernel::Container()->get(MenuSubscriber::class); | ||
|
||
$this->assertInternalType('array', $menuSubscriber::getSubscribedEvents()); | ||
} | ||
} |
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
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.