Skip to content

Commit

Permalink
Merge 5bb2f55 into 6cff486
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Davaillaud committed Jul 4, 2018
2 parents 6cff486 + 5bb2f55 commit fa7db9c
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -41,6 +41,8 @@ before_install:
- test "$SYMFONY_VERSION" -eq 4 || composer require --no-update "symfony/lts:^$SYMFONY_VERSION"
- cd tests/
- test "$SYMFONY_VERSION" -eq 4 || composer require --no-update "symfony/lts:^$SYMFONY_VERSION"
- test $(echo "$PHPVER<6.0" | bc) -ne 1 || composer require --no-update "phpdocumentor/reflection"
- test $(echo "$PHPVER>6.0" | bc) -ne 1 || composer require --no-update "phpdocumentor/reflection-docblock"
- cd ..

install:
Expand Down
6 changes: 3 additions & 3 deletions sources/lib/Resources/config/services/pomm.yml
Expand Up @@ -28,20 +28,20 @@ services:
class: 'PommProject\SymfonyBridge\PropertyInfo\Extractor\ListExtractor'
arguments: ['@pomm']
tags:
- { name: "property_info.list_extractor" }
- { name: "property_info.list_extractor" , priority: -900}
public: true
pomm.property_type_info:
class: 'PommProject\SymfonyBridge\PropertyInfo\Extractor\TypeExtractor'
arguments: ['@pomm']
tags:
- { name: "property_info.type_extractor" }
- { name: "property_info.type_extractor" , priority: -1005}
public: true
# @deprecated
pomm.property_info:
class: 'PommProject\SymfonyBridge\PropertyInfo\Extractor\PommExtractor'
arguments: ['@pomm']
tags:
- { name: "property_info.type_extractor" }
- { name: "property_info.type_extractor" , priority: -1005}
public: true
pomm.session_builder:
class: 'PommProject\Foundation\SessionBuilder'
Expand Down
30 changes: 30 additions & 0 deletions tests/src/AppBundle/Book.php
@@ -0,0 +1,30 @@
<?php

namespace AppBundle;
class Book
{
/**
* @var string
*/
public $title = 'title';
/**
* @var string
*/
public $author;

/**
* @return string
*/
public function getTitle()
{
return $this->title;
}

/**
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
}
}
32 changes: 32 additions & 0 deletions tests/src/AppBundle/Controller/IndexController.php
Expand Up @@ -149,6 +149,10 @@ public function propertyListAction()
);
}

/**
* @param string $property
* @return Response
*/
public function propertyTypeAction($property)
{
$info = $this->property->getTypes('AppBundle\Model\MyDb1\PublicSchema\Config', $property);
Expand All @@ -161,6 +165,34 @@ public function propertyTypeAction($property)
);
}

public function propertyListNotPommAction()
{
$info = $this->property->getProperties('AppBundle\Book');

return new Response(
$this->templating->render(
'AppBundle:Front:properties.html.twig',
compact('info')
)
);
}

/**
* @param string $property
* @return Response
*/
public function propertyTypeNotPommAction($property)
{
$info = $this->property->getTypes('AppBundle\Book', $property);

return new Response(
$this->templating->render(
'AppBundle:Front:property.html.twig',
compact('info')
)
);
}

public function serviceModelAction()
{
$model = $this->serviceSession->getModel('AppBundle\Model\MyDb1\PublicSchema\ServiceModel');
Expand Down
10 changes: 10 additions & 0 deletions tests/src/AppBundle/Resources/config/routing.yml
Expand Up @@ -43,11 +43,21 @@ property_list:
defaults: { _controller: index_controller:propertyListAction }
methods: [GET]

property_list_not_pomm:
path: /propertynotpomm
defaults: { _controller: index_controller:propertyListNotPommAction }
methods: [GET]

property_type:
path: /property/{property}
defaults: { _controller: index_controller:propertyTypeAction }
methods: [GET]

property_type_not_pomm:
path: /propertynotpomm/{property}
defaults: { _controller: index_controller:propertyTypeNotPommAction }
methods: [GET]

serviceModel:
path: /serviceModel
defaults: { _controller: index_controller:serviceModelAction }
Expand Down
10 changes: 10 additions & 0 deletions tests/tests/Features/property-info.feature
Expand Up @@ -5,7 +5,17 @@ Feature: Entity Param Converter
Then the response status code should be 200
Then I should see "name/value"

Scenario: property list not pomm
When I am on "/app_dev.php/propertynotpomm"
Then the response status code should be 200
Then I should see "title/author"

Scenario: property type
When I am on "/app_dev.php/property/name"
Then the response status code should be 200
Then I should see "string"

Scenario: property type not pomm
When I am on "/app_dev.php/propertynotpomm/title"
Then the response status code should be 200
Then I should see "string"

0 comments on commit fa7db9c

Please sign in to comment.