Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #55 from alexislefebvre/move-files-to-src-and-test…
Browse files Browse the repository at this point in the history
…s-directory

Move files to src/ and tests/ directory
  • Loading branch information
alexislefebvre authored Aug 8, 2018
2 parents 8de0af9 + bce7fd0 commit 1bce372
Show file tree
Hide file tree
Showing 55 changed files with 45 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ ratings:

exclude_paths:
- DataFixtures/ORM/*
- Tests/*
- tests/*
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/composer.lock

# Ignore files created during tests
/Tests/App/cache/
/Tests/App/logs/
/tests/App/cache/
/tests/App/logs/
/cov/

# Ignore Doxygen directory
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ checks:

filter:
excluded_paths:
- Tests/*
- tests/*
- Command/StatusesHomeTimelineTestCommand.php
paths:
- Command/*
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RECURSIVE = YES
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS = */vendor/* \
*/Tests/App/*
*/tests/App/*

#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
Expand Down
14 changes: 7 additions & 7 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default:
suites:
default:
paths:
features: Tests/Features
features: tests/Features
contexts:
- 'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\Features\Context\FeatureContext'
- Knp\FriendlyContexts\Context\AliceContext
Expand All @@ -14,22 +14,22 @@ default:
kernel:
env: test
debug: true
path: Tests/App/AppKernel.php
bootstrap: Tests/App/bootstrap.php
path: tests/App/AppKernel.php
bootstrap: tests/App/bootstrap.php
Behat\MinkExtension:
sessions:
default:
symfony2: ~
Knp\FriendlyContexts\Extension:
symfony_kernel:
bootstrap: Tests/App/bootstrap.php
path: Tests/App/AppKernel.php
bootstrap: tests/App/bootstrap.php
path: tests/App/AppKernel.php
class: AppKernel
env: test
debug: true
alice:
fixtures:
User: Tests/Fixtures/User.yml
Tweet: Tests/Fixtures/Tweet.yml
User: tests/Fixtures/User.yml
Tweet: tests/Fixtures/Tweet.yml
dependencies:
Tweet: [ User ]
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
},
"autoload" : {
"psr-4" : {
"AlexisLefebvre\\Bundle\\AsyncTweetsBundle\\" : ""
"AlexisLefebvre\\Bundle\\AsyncTweetsBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"AlexisLefebvre\\Bundle\\AsyncTweetsBundle\\Tests\\": "tests/"
}
}
}
3 changes: 3 additions & 0 deletions phpspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
suites:
tests:
spec_path: tests/
6 changes: 3 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
convertWarningsToExceptions="true"
>
<php>
<server name="KERNEL_DIR" value="Tests/App" />
<server name="KERNEL_DIR" value="tests/App" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>Tests</directory>
<directory>tests</directory>
</testsuite>
</testsuites>

Expand All @@ -27,7 +27,7 @@
<directory>Utils</directory>
<file>AsyncTweetsBundle.php</file>
<exclude>
<directory>Tests</directory>
<directory>tests</directory>
<directory>vendor/</directory>
<file>Command/StatusesShowCommand.php</file>
</exclude>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ protected function configure()
*/
protected function getTestContent($filename)
{
/* @see https://insight.sensiolabs.com/what-we-analyse/symfony.dependency_injection.use_dir_file_constant */
return json_decode(file_get_contents(
$this->container->get('kernel')->locateResource(
'@AsyncTweetsBundle/Tests/Command/data/'.$filename
)
sprintf(__DIR__.'/../../tests/Command/data/%s', $filename)
));
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Tests/App/config.yml → tests/App/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ parameters:
twitter_token_secret: null

services:
AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\:
resource: '../../DataFixtures'
AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\:
resource: '../DataFixtures'
tags: ['doctrine.fixture.orm']
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function testStatusesHomeTimelineWithTweetAndRetweet()
public function testStatusesHomeTimelineWithSinceIdParameter()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadTweetData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
]);

// Disable decoration for tests on Windows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testStatusesReadEmpty()
public function testStatusesReadWithTweets()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadTweetData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
]);

// Disable decoration for tests on Windows
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testNoTweets()
public function testTweets($path = null)
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadTweetData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\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\DataFixtures\ORM\LoadTweetPagesData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\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\DataFixtures\ORM\LoadTweetData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
]);

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

////////// Homepage //////////
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM;
namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\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\DataFixtures\ORM\LoadUserData'];
return ['AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadUserData'];
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

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

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -83,7 +83,7 @@ public function load(ObjectManager $manager)
public function getDependencies()
{
return [
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadMediaData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadMediaData',
];
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

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

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -106,7 +106,7 @@ public function load(ObjectManager $manager)
public function getDependencies()
{
return [
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadMediaData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadMediaData',
];
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

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

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down Expand Up @@ -78,7 +78,7 @@ public function load(ObjectManager $manager)
public function getDependencies()
{
return [
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadMediaData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadMediaData',
];
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

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

use AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\User;
use Doctrine\Common\DataFixtures\AbstractFixture;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function setUp()
public function testTweetRepository()
{
$this->loadFixtures([
'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadTweetData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\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\DataFixtures\ORM\LoadTweetData',
'AlexisLefebvre\Bundle\AsyncTweetsBundle\Tests\DataFixtures\ORM\LoadTweetData',
]);

/** @var Tweet $tweet */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1bce372

Please sign in to comment.