Skip to content

Commit

Permalink
Merge d29d067 into 6cff486
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Davaillaud committed Jul 3, 2018
2 parents 6cff486 + d29d067 commit 32b5c66
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
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 32b5c66

Please sign in to comment.