-
Notifications
You must be signed in to change notification settings - Fork 3
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
c86726a
commit 8426720
Showing
14 changed files
with
232 additions
and
250 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
nbproject | ||
._* | ||
.~lock.* | ||
.buildpath | ||
.DS_Store | ||
.idea | ||
.project | ||
.settings | ||
composer.lock | ||
|
||
test/TestConfig.php | ||
nbproject | ||
.project | ||
composer.lock | ||
vendor | ||
phpunit.xml |
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,7 @@ | ||
<phpunit bootstrap="./tests/Bootstrap.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="MobileDetectModule Module Tests"> | ||
<directory>./tests/MobileDetectModuleTest</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
TestConfig.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,16 @@ | ||
<?php | ||
use MobileDetectModuleTest\Util\ServiceManagerFactory; | ||
|
||
error_reporting(E_ALL | E_STRICT); | ||
chdir(__DIR__); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
if (file_exists(__DIR__ . '/TestConfig.php')) { | ||
$config = include __DIR__ . '/TestConfig.php'; | ||
} else { | ||
$config = include __DIR__ . '/TestConfig.php.dist'; | ||
} | ||
|
||
ServiceManagerFactory::setConfig($config); | ||
ServiceManagerFactory::getServiceManager(); |
58 changes: 29 additions & 29 deletions
58
...vc/Controller/Plugin/MobileDetectTest.php → ...vc/Controller/Plugin/MobileDetectTest.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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<?php | ||
/** | ||
* This file is part of the MobileDetectModule package. | ||
* | ||
* Copyright (c) Nikola Posa <posa.nikola@gmail.com> | ||
* | ||
* For full copyright and license information, please refer to the LICENSE file, | ||
* located at the package root folder. | ||
*/ | ||
|
||
namespace MobileDetectModuleTest\Mvc\Controller\Plugin; | ||
|
||
use PHPUnit_Framework_TestCase; | ||
use MobileDetectModule\Mvc\Controller\Plugin\MobileDetect as MobileDetectPlugin; | ||
|
||
/** | ||
* @author Nikola Posa <posa.nikola@gmail.com> | ||
*/ | ||
class MobileDetectTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testInvokationReturnsMobileDetectInstance() | ||
{ | ||
$mobileDetect = $this->getMock('Detection\MobileDetect', array(), array(), '', false); | ||
|
||
$plugin = new MobileDetectPlugin($mobileDetect); | ||
|
||
$this->assertSame($mobileDetect, $plugin()); | ||
} | ||
} | ||
<?php | ||
/** | ||
* This file is part of the MobileDetectModule package. | ||
* | ||
* Copyright (c) Nikola Posa <posa.nikola@gmail.com> | ||
* | ||
* For full copyright and license information, please refer to the LICENSE file, | ||
* located at the package root folder. | ||
*/ | ||
|
||
namespace MobileDetectModuleTest\Mvc\Controller\Plugin; | ||
|
||
use PHPUnit_Framework_TestCase; | ||
use MobileDetectModule\Mvc\Controller\Plugin\MobileDetect as MobileDetectPlugin; | ||
|
||
/** | ||
* @author Nikola Posa <posa.nikola@gmail.com> | ||
*/ | ||
class MobileDetectTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testInvokationReturnsMobileDetectInstance() | ||
{ | ||
$mobileDetect = $this->getMock('Detection\MobileDetect', array(), array(), '', false); | ||
|
||
$plugin = new MobileDetectPlugin($mobileDetect); | ||
|
||
$this->assertSame($mobileDetect, $plugin()); | ||
} | ||
} |
Oops, something went wrong.