Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Merge 691d909 into 7d73b23
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacePossum committed May 2, 2018
2 parents 7d73b23 + 691d909 commit 52cb8a2
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/Tests export-ignore
/TestsProject export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
tests.php export-ignore
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
language: php

sudo: false

git:
depth: 1

dist: trusty

php:
Expand All @@ -11,6 +16,7 @@ php:
- 7.2

matrix:
fast_finish: true
include:
# PHP 5.3 doesn't install on Trusty on Travis: https://github.com/travis-ci/travis-ci/issues/8219
- php: 5.3
Expand All @@ -24,20 +30,23 @@ matrix:
env: SYMFONY_VERSION=2.8.*
- php: 5.6
env: SYMFONY_VERSION=3.0.*

sudo: false
- php: 7.2
env: SYMFONY_VERSION=4.0.*

cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.composer

before_install:
- composer self-update
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi
- INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini;
- echo memory_limit = -1 >> $INI_FILE
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0

install:
- composer install
- composer info -D | sort

script: php tests.php
13 changes: 11 additions & 2 deletions Tests/View/TranslatedViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,25 @@ protected function setUp()
$this->routeGenerator = $this->createRouteGenerator();
}

protected function createOrGetMock($originalClassName)
{
if (method_exists($this, 'createMock')) {
return $this->createMock($originalClassName);
}

return $this->getMock($originalClassName);
}

private function createViewMock()
{
return $this->getMock($this->viewClass());
return $this->createOrGetMock($this->viewClass());
}

abstract protected function viewClass();

private function createTranslatorMock()
{
return $this->getMock('Symfony\Component\Translation\TranslatorInterface');
return $this->createOrGetMock('Symfony\Component\Translation\TranslatorInterface');
}

private function createTranslatedView()
Expand Down
4 changes: 3 additions & 1 deletion TestsProject/app/autoload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

$loader = require(__DIR__.'/../../vendor/autoload.php');
$loader->add('', __DIR__.'/../src');
$loader->add('', __DIR__.'/../src');

require_once __DIR__.'/AppKernel.php';
4 changes: 4 additions & 0 deletions TestsProject/app/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<phpunit bootstrap="autoload.php" colors="true">

<php>
<env name="KERNEL_CLASS" value="AppKernel" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
Expand Down
25 changes: 21 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,38 @@
}
],
"require": {
"php": ">=5.3",
"pagerfanta/pagerfanta": "1.0.*",
"symfony/framework-bundle": "~2.3|~3.0|~4.0",
"symfony/twig-bundle": "~2.3|~3.0|~4.0",
"symfony/property-access": "~2.3|~3.0|~4.0",
"pagerfanta/pagerfanta": "1.0.*"
"symfony/twig-bundle": "~2.3|~3.0|~4.0"
},
"require-dev": {
"symfony/symfony": "~2.3|~3.0|~4.0",
"phpunit/phpunit": "~3.7|~4.0"
"phpunit/phpunit": "~3.7|~4.0|^5.0"
},
"autoload": {
"psr-4": { "WhiteOctober\\PagerfantaBundle\\": "" }
"classmap": [
"WhiteOctoberPagerfantaBundle.php"
],
"psr-4": {
"WhiteOctober\\PagerfantaBundle\\DependencyInjection\\": "DependencyInjection",
"WhiteOctober\\PagerfantaBundle\\EventListener\\": "EventListener",
"WhiteOctober\\PagerfantaBundle\\Twig\\": "Twig",
"WhiteOctober\\PagerfantaBundle\\View\\": "View"
}
},
"autoload-dev": {
"psr-4": {
"WhiteOctober\\PagerfantaBundle\\Tests\\": "Tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"config": {
"sort-packages": true
}
}

0 comments on commit 52cb8a2

Please sign in to comment.