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

Use Acme namespaces for tests #59

Merged
merged 1 commit into from Aug 10, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions behat.yml
Expand Up @@ -4,7 +4,7 @@ default:
paths:
features: tests/Features
contexts:
- 'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Features\Context\FeatureContext'
- 'Acme\Features\Context\FeatureContext'
- Knp\FriendlyContexts\Context\AliceContext
- Knp\FriendlyContexts\Context\EntityContext
- Knp\FriendlyContexts\Context\MinkContext
Expand All @@ -14,7 +14,7 @@ default:
kernel:
env: test
debug: true
path: tests/App/AppKernel.php
class: Acme\App\AppKernel
bootstrap: tests/App/bootstrap.php
Behat\MinkExtension:
sessions:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -39,7 +39,7 @@
},
"autoload-dev": {
"psr-4": {
"AlexisLefebvre\\Bundle\\AsyncTweetsBundle\\Tests\\": "tests/"
"Acme\\": "tests/"
}
}
}
1 change: 1 addition & 0 deletions phpunit.xml.dist
Expand Up @@ -11,6 +11,7 @@
>
<php>
<server name="KERNEL_DIR" value="tests/App" />
<server name="KERNEL_CLASS" value="Acme\App\AppKernel" />
</php>

<testsuites>
Expand Down
24 changes: 13 additions & 11 deletions tests/App/AppKernel.php
@@ -1,11 +1,13 @@
<?php

// Tests/Controller/App/AppKernel.php
namespace Acme\App;

/** @see http://www.whitewashing.de/2012/02/25/symfony2_controller_testing.html */
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;

/**
* @see http://www.whitewashing.de/2012/02/25/symfony2_controller_testing.html
*/
class AppKernel extends Kernel
{
/**
Expand All @@ -24,15 +26,15 @@ public function __construct($environment, $debug)
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new AlexisLefebvre\Bundle\AsyncTweetsBundle\AsyncTweetsBundle(),
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
new Liip\FunctionalTestBundle\LiipFunctionalTestBundle(),
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Symfony\Bundle\SecurityBundle\SecurityBundle(),
new \Symfony\Bundle\TwigBundle\TwigBundle(),
new \Symfony\Bundle\MonologBundle\MonologBundle(),
new \Symfony\Bundle\AsseticBundle\AsseticBundle(),
new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new \AlexisLefebvre\Bundle\AsyncTweetsBundle\AsyncTweetsBundle(),
new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
new \Liip\FunctionalTestBundle\LiipFunctionalTestBundle(),
];

return $bundles;
Expand Down
2 changes: 1 addition & 1 deletion tests/App/config.yml
Expand Up @@ -51,6 +51,6 @@ parameters:
twitter_token_secret: null

services:
AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\:
Acme\DataFixtures\:
resource: '../DataFixtures'
tags: ['doctrine.fixture.orm']
2 changes: 1 addition & 1 deletion tests/Command/StatusesBase.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Command;
namespace Acme\Command;

use Liip\FunctionalTestBundle\Test\WebTestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
Expand Down
5 changes: 2 additions & 3 deletions tests/Command/StatusesHomeTimelineTest.php
@@ -1,8 +1,7 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Command;
namespace Acme\Command;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesHomeTimelineTestCommand;
use Symfony\Component\Console\Tester\CommandTester;

class StatusesHomeTimelineTest extends StatusesBase
Expand Down Expand Up @@ -264,7 +263,7 @@ public function testStatusesHomeTimelineWithTweetAndRetweet()
public function testStatusesHomeTimelineWithSinceIdParameter()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
'Acme\DataFixtures\ORM\LoadTweetData',
]);

// Disable decoration for tests on Windows
Expand Down
@@ -1,7 +1,8 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Command;
namespace Acme\Command;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesHomeTimelineCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;

Expand Down
4 changes: 2 additions & 2 deletions tests/Command/StatusesReadTest.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Command;
namespace Acme\Command;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesReadCommand;
use Symfony\Component\Console\Tester\CommandTester;
Expand Down Expand Up @@ -41,7 +41,7 @@ public function testStatusesReadEmpty()
public function testStatusesReadWithTweets()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
'Acme\DataFixtures\ORM\LoadTweetData',
]);

// Disable decoration for tests on Windows
Expand Down
12 changes: 6 additions & 6 deletions tests/Controller/DefaultControllerTest.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Controller;
namespace Acme\Controller;

use Liip\FunctionalTestBundle\Test\WebTestCase;

Expand Down Expand Up @@ -35,7 +35,7 @@ public function testNoTweets()
public function testTweets($path = null)
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
'Acme\DataFixtures\ORM\LoadTweetData',
]);

if (is_null($path)) {
Expand Down Expand Up @@ -142,7 +142,7 @@ public function testSinceTweetId()
public function testTweetsPages()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetPagesData',
'Acme\DataFixtures\ORM\LoadTweetPagesData',
]);

$path = '/sinceId/15';
Expand Down Expand Up @@ -292,7 +292,7 @@ public function testTweetsPages()
public function testCookie()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
'Acme\DataFixtures\ORM\LoadTweetData',
]);

$tweetId = 49664;
Expand Down Expand Up @@ -372,7 +372,7 @@ public function testCookie()
public function testDeleteTweets()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetPagesData',
'Acme\DataFixtures\ORM\LoadTweetPagesData',
]);

$path = '/sinceId/15';
Expand Down Expand Up @@ -591,7 +591,7 @@ public function testDeleteTweets()
public function testHideRetweetedTweets()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetAndRetweetData',
'Acme\DataFixtures\ORM\LoadTweetAndRetweetData',
]);

////////// Homepage //////////
Expand Down
4 changes: 2 additions & 2 deletions tests/DataFixtures/ORM/LoadMediaData.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM;
namespace Acme\DataFixtures\ORM;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Media;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -46,6 +46,6 @@ public function load(ObjectManager $manager)
*/
public function getDependencies()
{
return ['AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadUserData'];
return ['Acme\DataFixtures\ORM\LoadUserData'];
}
}
6 changes: 2 additions & 4 deletions tests/DataFixtures/ORM/LoadTweetAndRetweetData.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM;
namespace Acme\DataFixtures\ORM;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -82,8 +82,6 @@ public function load(ObjectManager $manager)
*/
public function getDependencies()
{
return [
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadMediaData',
];
return ['Acme\DataFixtures\ORM\LoadMediaData'];
}
}
6 changes: 2 additions & 4 deletions tests/DataFixtures/ORM/LoadTweetData.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM;
namespace Acme\DataFixtures\ORM;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -105,8 +105,6 @@ public function load(ObjectManager $manager)
*/
public function getDependencies()
{
return [
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadMediaData',
];
return ['Acme\DataFixtures\ORM\LoadMediaData'];
}
}
6 changes: 2 additions & 4 deletions tests/DataFixtures/ORM/LoadTweetPagesData.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM;
namespace Acme\DataFixtures\ORM;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -77,8 +77,6 @@ public function load(ObjectManager $manager)
*/
public function getDependencies()
{
return [
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadMediaData',
];
return ['Acme\DataFixtures\ORM\LoadMediaData'];
}
}
2 changes: 1 addition & 1 deletion tests/DataFixtures/ORM/LoadUserData.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM;
namespace Acme\DataFixtures\ORM;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\User;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/MediaTest.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Entity;
namespace Acme\Entity;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Media;

Expand Down
6 changes: 3 additions & 3 deletions tests/Entity/TweetRepositoryTest.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Entity;
namespace Acme\Entity;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Liip\FunctionalTestBundle\Test\WebTestCase;
Expand All @@ -22,7 +22,7 @@ public function setUp()
public function testTweetRepository()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
'Acme\DataFixtures\ORM\LoadTweetData',
]);

$tweets = $this->em
Expand Down Expand Up @@ -53,7 +53,7 @@ public function testTweetRepository()
public function testTweetRepositoryWithLongTweet()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
'Acme\DataFixtures\ORM\LoadTweetData',
]);

/** @var Tweet $tweet */
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/TweetTest.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Entity;
namespace Acme\Entity;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Media;
use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/UserTest.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Entity;
namespace Acme\Entity;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\User;

Expand Down
2 changes: 1 addition & 1 deletion tests/Features/Context/FeatureContext.php
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Features\Context;
namespace Acme\Features\Context;

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Behat\Behat\Context\Context;
Expand Down