Skip to content

Commit

Permalink
Fix codestyle. Added docblocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxuator committed Apr 20, 2012
1 parent be174d1 commit 30f7f0a
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Controller/PageAdminController.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php

namespace Stfalcon\Bundle\PageBundle\Controller;

use Sonata\AdminBundle\Controller\CRUDController as Controller;

/**
* Page Admin Controller class
*/
class PageAdminController extends Controller
{

}
9 changes: 7 additions & 2 deletions Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

use Stfalcon\Bundle\PageBundle\Entity\Page;

/**
Expand All @@ -18,12 +19,16 @@ class PageController extends Controller
/**
* Finds and displays a Page entity.
*
* @Route("/{slug}", name="page_show")
* @param \Stfalcon\Bundle\PageBundle\Entity\Page $page
*
* @Route ("/{slug}", name="page_show")
* @Template()
*
* @return array
*/
public function showAction(Page $page)
{
return array('page' => $page);
}

}
8 changes: 8 additions & 0 deletions DataFixtures/ORM/LoadPagesData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
use Stfalcon\Bundle\PageBundle\Entity\Page;
use Doctrine\Common\Persistence\ObjectManager;

/**
* Fixtures for the pages
*/
class LoadPagesData extends AbstractFixture
{
/**
* Load data fixtures with the passed EntityManager
*
* @param \Doctrine\Common\Persistence\ObjectManager $manager
*/
public function load(ObjectManager $manager)
{
$page = new Page();
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder
*/
public function getConfigTreeBuilder()
{
Expand Down
5 changes: 4 additions & 1 deletion DependencyInjection/StfalconPageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
class StfalconPageExtension extends Extension
{
/**
* {@inheritDoc}
* Loads a specific configuration.
*
* @param array $configs An array of configuration values
* @param ContainerBuilder $container A ContainerBuilder instance
*/
public function load(array $configs, ContainerBuilder $container)
{
Expand Down
3 changes: 3 additions & 0 deletions StfalconPageBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* Page bundle
*/
class StfalconPageBundle extends Bundle
{
}
3 changes: 3 additions & 0 deletions Tests/Controller/PageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
class PageControllerTest extends WebTestCase
{

/**
* Test of the page view controller
*/
public function testBrowsePage()
{
$this->loadFixtures(array('Stfalcon\Bundle\PageBundle\DataFixtures\ORM\LoadPagesData'));
Expand Down
20 changes: 19 additions & 1 deletion Tests/Entity/PageEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@
use Stfalcon\Bundle\PageBundle\Entity\Page;

/**
* test Page entity
* Test Page entity
*/
class PageEntityTest extends \PHPUnit_Framework_TestCase
{

/**
* Check if the Page ID is null
*/
public function testEmptyPageIdisNull()
{
$page = new Page();
$this->assertNull($page->getId());
}

/**
* Check the getter and the setter of the `text` property
*/
public function testSetAndGetPageText()
{
$text = "Design can help you improve your sustainability credentials, create products and services that make people happy and it has positive benefits on business's bottom line.";
Expand All @@ -26,6 +32,9 @@ public function testSetAndGetPageText()
$this->assertEquals($text, $page->getText());
}

/**
* Check the getter and the setter of the `slug` property
*/
public function testSetAndGetPageSlug()
{
$page = new Page();
Expand All @@ -36,6 +45,9 @@ public function testSetAndGetPageSlug()
$this->assertEquals($slug, $page->getSlug());
}

/**
* Check the getter and the setter of the `title` property
*/
public function testGetAndAddPageTitle()
{
$page = new Page();
Expand All @@ -47,6 +59,9 @@ public function testGetAndAddPageTitle()

}

/**
* Check the getter and the setter of the `metaKeywords` property
*/
public function testSetAndGetMetaKeywords()
{
$page = new Page();
Expand All @@ -58,6 +73,9 @@ public function testSetAndGetMetaKeywords()

}

/**
* Check the getter and the setter of the `metaDescription` property
*/
public function testSetAndGetMetaDescription()
{
$page = new Page();
Expand Down

0 comments on commit 30f7f0a

Please sign in to comment.