This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(__DIR__ . "/../../../../app/AppKernel.php"); | |
class ModelTestCase extends \PHPUnit_Framework_TestCase | |
{ | |
protected $_application; | |
public function getContainer() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctrine: | |
dbal: | |
driver: pdo_sqlite | |
path: :memory: | |
memory: true | |
orm: | |
auto_generate_proxy_classes: true | |
auto_mapping: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Dodajemy w routing.yml | |
tickets: | |
type: rest | |
resource: Xs\TicketingBundle\Controller\TicketsController | |
#Pobieranie ticketów metodą GET | |
/tickets -> function getTicketsAction() {...} | |
#Tworzenie ticketa metodą POST | |
/tickets -> function postTicketsAction() {...} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SendMailingCommand extends ContainerAwareCommand | |
{ | |
protected function execute(InputInterface $input, OutputInterface $output) | |
{ | |
$logger = function($message) use ($output) | |
{ | |
$output->writeln($message); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class NewsletterManager implements NewsletterManagerInterface | |
{ | |
public function getJobFromQueueAndSendMailing(\Closure $logger, $verbose) | |
{ | |
// [...] | |
if ($verbose) { | |
$logger(sprintf("Sent message:\n%s", $message->toString())); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MailingType extends AbstractType | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('body', 'textarea', array('class' => 'tinymce')); // it won't work! | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% form_theme form _self %} | |
{% block _wowo_bundle_newsletterbundle_newslettertype_mailing_body_widget %} | |
{{ form_widget(form, { 'attr': {'class': 'tinymce'}}) }} | |
{% endblock %} | |
<form action="" method="post" {{ form_enctype(form) }} > | |
{{ form_widget(form) }} | |
<input type="submit" value="{% trans %}Send mailing{% endtrans %}"/> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MailingType extends AbstractType | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
//this is ain't documented but it works! :-) | |
$builder | |
->add('body', 'textarea', | |
array('attr' => array('class' => 'tinymce'))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// [...] | |
$loader->registerNamespaces(array( | |
// [...] | |
'lapistano' => __DIR__.'/../vendor/proxy-object/src/lapistano', | |
)); | |
// [...] | |
// this one's important! you need it only with PHPUnit, so there's a condition | |
if (class_exists('PHPUnit_Runner_Version')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Proxy-Object] | |
git=https://github.com/lapistano/proxy-object.git | |
target=/proxy-object |