Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1.0 b #11

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function registerBundles()
// if is mongo or orm load modules
if (in_array($this->getEnvironment(), array('dev', 'test', 'prod'))) {
$bundles[] = new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle();
} else if (in_array($this->getEnvironment(), array('orm_dev', 'orm_test', 'orm_prod'))) {
} elseif (in_array($this->getEnvironment(), array('orm_dev', 'orm_test', 'orm_prod'))) {
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
$bundles[] = new Doctrine\Bundle\DoctrineBundle\DoctrineBundle();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block body %}{% endblock %}
{% block body %}leaphly{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
2 changes: 1 addition & 1 deletion app/config/config_base_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ swiftmailer:

# stub for http client.
parameters:
acme.demo.http_client.class: Acme\SimplePurchaseProcessBundle\Tests\Mock\MockedHttpClient
acme.demo.http_client.class: Acme\SimplePurchaseProcessBundle\Tests\Mock\MockedHttpClient
2 changes: 1 addition & 1 deletion app/config/config_dev.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
imports:
- { resource: leaphly/dbdriver.mongodb.yml }
- { resource: config_base_dev.yml }
- { resource: config_base_dev.yml }
2 changes: 1 addition & 1 deletion app/config/leaphly/dbdriver.mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ leaphly_cart:
full:
form: acme_cart.cart.form.type
limited:
form: acme_cart.cart.limited.form.type
form: acme_cart.cart.limited.form.type
2 changes: 1 addition & 1 deletion app/config/leaphly/rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ fos_js_routing:
- api_1_put_cart
- api_1_post_cart_item
- api_1_delete_cart_item
- api_1_delete_cart_items
- api_1_delete_cart_items
6 changes: 3 additions & 3 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ parameters:
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_user: travis
database_password: ~

mailer_transport: smtp
mailer_host: 127.0.0.1
Expand All @@ -14,5 +14,5 @@ parameters:
locale: en
secret: ThisTokenIsNotSoSecretChangeIt

leaphly_api_host: http://localhost
leaphly_api_port: 8000
leaphly_api_host: http://cart.local
leaphly_api_port: 80
9 changes: 8 additions & 1 deletion app/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ simple_purchase_process:
resource: "@SimplePurchaseProcessBundle/Resources/config/routing.xml"
prefix: /purchase-process

leaphly_content_install_sandbox:
path: /install-the-sandbox
defaults:
_controller: FrameworkBundle:Redirect:urlRedirect
path: http://doc.leaphly.org/book/installation.html
permanent: true
#
leaphly_cart:
type: rest
resource: "@AcmeCartBundle/Resources/config/rest.xml"
Expand All @@ -31,4 +38,4 @@ logout:
# used to create the route via template handler
documentation:
path: /
host: doc.leaphly.org
host: doc.leaphly.org
2 changes: 2 additions & 0 deletions app/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory>
<directory>../vendor/leaphly/*/*Bundle/Tests</directory>
<directory>../vendor/leaphly/*/Bundle/*Bundle/Tests</directory>
</testsuite>
</testsuites>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function load(array $configs, ContainerBuilder $container)
$this->loadDbDriver($config, $container, $loader);
}


private function loadDbDriver($config, ContainerBuilder $container, XmlFileLoader $loader)
{
$loader->load(sprintf('%s.xml', $config['db_driver']));
Expand Down
8 changes: 1 addition & 7 deletions src/Acme/CartBundle/Document/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
use Doctrine\Common\Collections\ArrayCollection;
use Leaphly\Cart\Model\Cart as BaseCart;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

/**
* @MongoDB\Document
Expand Down Expand Up @@ -53,4 +47,4 @@ public function getCustomer()
{
return $this->customer;
}
}
}
3 changes: 1 addition & 2 deletions src/Acme/CartBundle/Document/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Acme\CartBundle\Document;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;

/**
Expand Down Expand Up @@ -80,4 +79,4 @@ public function __toString()
{
return $this->getName();
}
}
}
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Entity/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ public function getCustomer()
{
return $this->customer;
}
}
}
3 changes: 1 addition & 2 deletions src/Acme/CartBundle/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,4 @@ public function getPrice()
return $this->price;
}


}
}
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Form/Type/CartFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CartFormType extends BaseCartFormType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Form/Type/LimitedCartFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LimitedCartFormType extends BaseCartFormType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Resources/config/mongodb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
<argument>%acme_cart.product.class%</argument>
</service>
</services>
</container>
</container>
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Resources/config/orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
<argument>%acme_cart.product.class%</argument>
</service>
</services>
</container>
</container>
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Resources/config/rest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<import id="carts_full" type="rest" resource="leaphly_cart.cart.full.controller" name-prefix="api_1_full_" prefix="/full" />
<import id="cartItems_full" type="rest" resource="leaphly_cart.cart_item.full.controller" name-prefix="api_1_full_" parent="carts_full" prefix="/full" />
<import id="cartTransitions" type="rest" resource="Leaphly\CartBundle\Controller\CartTransitionsController" name-prefix="api_1_" parent="carts" />
</routes>
</routes>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Acme\CartBundle\DependencyInjection\AcmeCartExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Leaphly\CartBundle\DependencyInjection\LeaphlyCartExtension;
use Symfony\Component\Yaml\Parser;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ public function load(ObjectManager $manager)

FixtureCollector::addCart(FixtureCollector::MONGODB, $cart);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function load(ObjectManager $manager)
FixtureCollector::addProduct(FixtureCollector::MONGODB, $tshirt->getId());
FixtureCollector::addProduct(FixtureCollector::MONGODB, $ticket->getId());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function load(ObjectManager $manager)
FixtureCollector::addProduct(FixtureCollector::ORM, $tshirt->getId());
FixtureCollector::addProduct(FixtureCollector::ORM, $ticket->getId());
}
}
}
7 changes: 4 additions & 3 deletions src/Acme/CartBundle/Tests/Fixture/FixtureCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/**
* Class FixtureCollector, just a fixture container, useful when you need the Id of the entity inserted.
*/
final class FixtureCollector {

final class FixtureCollector
{
const MONGODB = 'doctrine_mongodb';
const ORM = 'doctrine';

Expand Down Expand Up @@ -35,6 +35,7 @@ public static function getCarts($doctrine)
public static function getProducts($doctrine)
{
$products = isset(self::$products[$doctrine])? self::$products[$doctrine] : array();

return $products;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ public function testListenerShouldAutomaticallySetTheCartPriceViaRest($env, $fix
$this->assertGreaterThan(0, $cart->getPrice());
$this->assertGreaterThan(0, $cart->getFinalPrice());
}
}
}
2 changes: 1 addition & 1 deletion src/Acme/CartBundle/Tests/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ public function multiEnvProvider()
);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function load(ObjectManager $manager)

$manager->flush();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public function load(ObjectManager $manager)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function load(array $configs, ContainerBuilder $container)
$this->loadDbDriver($config, $container, $loader);
}


private function loadDbDriver($config, ContainerBuilder $container, XmlFileLoader $loader)
{
$loader->load(sprintf('%s.xml', $config['db_driver']));
Expand Down
7 changes: 1 addition & 6 deletions src/Acme/Product/ConferenceBundle/Document/TicketItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ class TicketItem extends BaseItem
*/
protected $when;


/**
* @var
* @MongoDB\Field(type="string")
*/
protected $position;


/**
* @var
* @MongoDB\Field(type="int")
*/
protected $adults;


/**
* @var
* @MongoDB\Field(type="int")
Expand Down Expand Up @@ -72,7 +69,6 @@ public function getProduct()
return $this->product;
}


/**
* @param mixed $adults
*/
Expand Down Expand Up @@ -137,7 +133,6 @@ public function getWhen()
return $this->when;
}


/**
* @param string $conferenceName
*/
Expand All @@ -153,4 +148,4 @@ public function getConferenceName()
{
return $this->conferenceName;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function getType()
{
return 'ticket';
}
}
}
5 changes: 0 additions & 5 deletions src/Acme/Product/ConferenceBundle/Entity/TicketItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,24 @@ class TicketItem extends BaseItem
*/
protected $conferenceName;


/**
* @var \Datetime $when
* @ORM\Column(type="datetime", nullable=true, name="when_date")
*/
protected $when;


/**
* @var string $position
* @ORM\Column(type="string", nullable=true)
*/
protected $position;


/**
* @var integer $adults
* @ORM\Column(type="integer", nullable=true)
*/
protected $adults;


/**
* @var integer $children
* @ORM\Column(type="integer", nullable=true)
Expand Down Expand Up @@ -148,5 +144,4 @@ public function getWhen()
return $this->when;
}


}
2 changes: 1 addition & 1 deletion src/Acme/Product/ConferenceBundle/Entity/TicketProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public function getType()
{
return 'ticket';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TicketItemFullAccessType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Acme/Product/ConferenceBundle/Form/TicketItemType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct($product_id = null)

/**
* @param FormBuilderInterface $builder
* @param array $options
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
Expand Down
Loading