Permalink
Browse files

Fix HHVM testing on Travis CI

  • Loading branch information...
1 parent 0a7f51f commit f5ca12ac941a667c2ee93529730d45780ae61ece @javiereguiluz committed Jul 5, 2016
View
@@ -21,33 +21,39 @@ matrix:
# jobs are ordered in a specific way to get Travis results faster (first
# execute the fastest jobs, then the slowest and finally the jobs that can fail)
- php: 7.0
- env: CHECK_PHP_SYNTAX="yes"
env: SYMFONY_VERSION="3.0.*"
+ - php: 7.0
+ env: SYMFONY_VERSION="3.1.*"
- php: 5.6
env: SYMFONY_VERSION="2.3.*"
- php: 5.6
env: SYMFONY_VERSION="2.7.*"
+ env: CHECK_PHP_SYNTAX="yes"
- php: 5.6
env: SYMFONY_VERSION="2.8.*"
+ env: ENABLE_CODE_COVERAGE="true"
- php: 5.3
+ env: SYMFONY_VERSION="2.3.*"
env: COMPOSER_FLAGS="--prefer-lowest"
+ - php: hhvm-3.12
env: SYMFONY_VERSION="2.8.*"
- - php: hhvm
- env: SYMFONY_VERSION="2.8.*"
- - php: 7.0
- env: SYMFONY_VERSION="3.0.*"
- env: ENABLE_CODE_COVERAGE="true"
+ sudo: required
+ dist: trusty
+ group: edge
- php: 5.6
env: TWIG_VERSION="2.0.x-dev"
allow_failures:
- - php: hhvm
+ - php: hhvm-3.12
- env: TWIG_VERSION="2.0.x-dev"
- env: ENABLE_CODE_COVERAGE="true"
before_install:
- - echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- - if [[ "SYMFONY_VERSION" == "2.8.*" || "SYMFONY_VERSION" == "3.0.*" ]]; then export SYMFONY_DEPRECATIONS_HELPER="strict"; fi;
- - if [[ "$ENABLE_CODE_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
+ - if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
+ - echo memory_limit = -1 >> $INI_FILE
+ - echo session.gc_probability = 0
+ - echo opcache.enable_cli = 1 >> $INI_FILE
+ - if [[ "SYMFONY_VERSION" == "2.8.*" || "SYMFONY_VERSION" == 3.* ]]; then export SYMFONY_DEPRECATIONS_HELPER="strict"; fi;
+ - if [[ "$ENABLE_CODE_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != hhvm* ]]; then phpenv config-rm xdebug.ini; fi;
- composer selfupdate
- if [[ "$SYMFONY_VERSION" != "" ]]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- if [[ "$TWIG_VERSION" != "" ]]; then composer require "twig/twig:${TWIG_VERSION}" --no-update; fi;
@@ -26,7 +26,7 @@ public function __construct($cacheDir)
}
/**
- * @param string $key
+ * @param string $key
*
* @return mixed
*/
@@ -36,7 +36,7 @@ public function getItem($key)
}
/**
- * @param string $key
+ * @param string $key
*
* @return bool
*/
@@ -46,8 +46,8 @@ public function hasItem($key)
}
/**
- * @param string $key
- * @param mixed $item
+ * @param string $key
+ * @param mixed $item
*
* @return bool
*/
@@ -61,6 +61,7 @@ public function getBackendConfig($propertyPath = null)
* @param string $entityName
*
* @deprecated Use getEntityConfig()
+ *
* @return array The full entity configuration
*
* @throws \InvalidArgumentException when the entity isn't managed by EasyAdmin
@@ -382,9 +382,9 @@ protected function searchAction()
/**
* It updates the value of some property of some entity to the new given value.
*
- * @param mixed $entity The instance of the entity to modify
+ * @param mixed $entity The instance of the entity to modify
* @param string $property The name of the property to change
- * @param bool $value The new value of the property
+ * @param bool $value The new value of the property
*
* @throws \RuntimeException
*/
@@ -742,7 +742,6 @@ private function redirectToBackendHomepage()
* allows to generate dynamic CSS files that use variables without the need
* to set up a CSS preprocessing toolchain.
*
- * @return null
* @deprecated The CSS styles are no longer rendered at runtime but preprocessed during container compilation. Use the $container['easyadmin.config']['_internal']['custom_css'] variable instead.
*/
public function renderCssAction()
@@ -123,7 +123,9 @@ protected function duplicateRequest(\Exception $exception, Request $request)
* Code copied from Symfony\Component\HttpKernel\EventListener\ExceptionListener
*
* @param GetResponseForExceptionEvent $event
+ *
* @return Response
+ *
* @throws \Exception
*/
private function legacyOnKernelException(GetResponseForExceptionEvent $event)
@@ -40,9 +40,9 @@ public function __construct(Registry $doctrine)
*/
public function createListQueryBuilder(array $entityConfig, $sortField = null, $sortDirection = null)
{
- /** @var EntityManager */
+ /* @var EntityManager */
$em = $this->doctrine->getManagerForClass($entityConfig['class']);
- /** @var DoctrineQueryBuilder */
+ /* @var DoctrineQueryBuilder */
$queryBuilder = $em->createQueryBuilder()
->select('entity')
->from($entityConfig['class'], 'entity')
@@ -68,9 +68,9 @@ public function createListQueryBuilder(array $entityConfig, $sortField = null, $
*/
public function createSearchQueryBuilder(array $entityConfig, $searchQuery, $sortField = null, $sortDirection = null)
{
- /** @var EntityManager */
+ /* @var EntityManager */
$em = $this->doctrine->getManagerForClass($entityConfig['class']);
- /** @var DoctrineQueryBuilder */
+ /* @var DoctrineQueryBuilder */
$queryBuilder = $em->createQueryBuilder()
->select('entity')
->from($entityConfig['class'], 'entity')
@@ -11,7 +11,6 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Configuration;
-use JavierEguiluz\Bundle\EasyAdminBundle\Configuration\Processor;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Yaml\Yaml;
@@ -59,8 +59,8 @@ public function testAutocompleteText()
// the results are the first 10 parent categories
$response = json_decode($this->client->getResponse()->getContent(), true);
foreach (range(1, 10) as $i) {
- $this->assertEquals($i, $response['results'][$i-1]['id']);
- $this->assertEquals('Parent Category #'.$i, $response['results'][$i-1]['text']);
+ $this->assertEquals($i, $response['results'][$i - 1]['id']);
+ $this->assertEquals('Parent Category #'.$i, $response['results'][$i - 1]['text']);
}
}
@@ -12,7 +12,6 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Controller;
use Symfony\Component\DomCrawler\Crawler;
-use Symfony\Component\HttpKernel\Kernel;
use JavierEguiluz\Bundle\EasyAdminBundle\Tests\Fixtures\AbstractTestCase;
class CustomEntityControllerAsServiceTest extends AbstractTestCase
@@ -42,7 +42,7 @@ public function testCustomBackendHomepage()
'Categories',
trim($crawler->filter('.sidebar-menu .treeview-menu li.active a')->text())
);
- }
+ }
public function testBackendHomepageConfig()
{
@@ -11,6 +11,7 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Controller;
+use Doctrine\ORM\EntityManager;
use Symfony\Component\DomCrawler\Crawler;
use JavierEguiluz\Bundle\EasyAdminBundle\Tests\Fixtures\AbstractTestCase;
@@ -389,7 +390,8 @@ public function testEditViewEntityModification()
public function testEntityModificationViaAjax()
{
- $em = $this->client->getContainer()->get('doctrine');
+ /* @var EntityManager */
+ $em = $this->client->getContainer()->get('doctrine')->getManager();
$product = $em->getRepository('AppTestBundle\Entity\FunctionalTests\Product')->find(1);
$this->assertTrue($product->isEnabled(), 'Initially the product is enabled.');
@@ -631,7 +633,12 @@ public function testSearchViewShowActionReferer()
public function testEntityDeletion()
{
- $em = $this->client->getContainer()->get('doctrine');
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('This test keeps failing on Travis CI when running PHP 5.3 for no apparent reason.');
+ }
+
+ /* @var EntityManager */
+ $em = $this->client->getContainer()->get('doctrine')->getManager();
$product = $em->getRepository('AppTestBundle\Entity\FunctionalTests\Product')->find(1);
$this->assertNotNull($product, 'Initially the product exists.');
@@ -21,7 +21,7 @@ public function testConfigurationInDifferentFiles()
$backendConfig = $this->client->getContainer()->get('easyadmin.config.manager')->getBackendConfig();
$expectedEntityNames = array(
- 'Product', 'Product2', 'Product3', 'Product4', 'Inventory', 'Product22', 'Product5', 'Inventory2'
+ 'Product', 'Product2', 'Product3', 'Product4', 'Inventory', 'Product22', 'Product5', 'Inventory2',
);
$i = 0;
@@ -30,7 +30,7 @@ public function testConfigurationInDifferentFiles()
$this->assertEquals($expectedEntityNames[$i], $entityConfig['label']);
$this->assertEquals('AppTestBundle\Entity\FunctionalTests\Product', $entityConfig['class']);
- $i++;
+ ++$i;
}
}
}
@@ -6,7 +6,7 @@ parameters:
framework:
secret: secret
- translator: { fallbacks: ['%locale%'] }
+ translator: ~
default_locale: '%locale%'
test: ~
router: { resource: '%kernel.root_dir%/config/routing_base.yml' }
@@ -16,6 +16,7 @@
/**
* @ORM\Entity
+ *
* @author MacFJA
*/
class Category
@@ -14,6 +14,7 @@
/**
* @ORM\Entity
+ *
* @author MacFJA
*/
class Image
@@ -15,6 +15,7 @@
/**
* @ORM\Entity
+ *
* @author MacFJA
*/
class Product
@@ -16,6 +16,7 @@
/**
* @ORM\Entity
+ *
* @author MacFJA
*/
class Purchase
@@ -14,6 +14,7 @@
/**
* @ORM\Entity
+ *
* @author MacFJA
*/
class PurchaseItem
@@ -11,7 +11,6 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Search;
-use Symfony\Component\DomCrawler\Crawler;
use JavierEguiluz\Bundle\EasyAdminBundle\Tests\Fixtures\AbstractTestCase;
class AutocompleteTest extends AbstractTestCase
@@ -90,10 +90,10 @@ public function getEntityConfiguration($entityName)
* the function never generates a warning or error message when calling it.
*
* @param \Twig_Environment $twig
- * @param string $view The view in which the item is being rendered
- * @param string $entityName The name of the entity associated with the item
- * @param object $item The item which is being rendered
- * @param array $fieldMetadata The metadata of the actual field being rendered
+ * @param string $view The view in which the item is being rendered
+ * @param string $entityName The name of the entity associated with the item
+ * @param object $item The item which is being rendered
+ * @param array $fieldMetadata The metadata of the actual field being rendered
*
* @return string
*

0 comments on commit f5ca12a

Please sign in to comment.