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
// works in production | |
core:PRIMARY> db.test.insert({test:new Date('2014-01-29 03:00')}) | |
core:PRIMARY> db.test.find().pretty() | |
{ | |
"_id" : ObjectId("52e930ef400853587d69153f"), | |
"test" : ISODate("1970-01-01T00:00:00Z") | |
} | |
// does not work in other dev/local envs |
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 | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\Common\Persistence\ObjectManager; | |
class ObjectSerializer | |
{ | |
private $om; | |
public function __construct(ObjectManager $om) |
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 | |
use PHPUnit_Framework_TestCase; | |
use Symfony\Component\DomCrawler\Crawler; | |
class SimpleHttpTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testHttp() | |
{ | |
$crawler = new Crawler(file_get_contents('http://myapp.lcl/hello/Jon')); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | |
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | |
<entity name="Doctrine\Tests\ORM\Mapping\User" table="cms_users"> | |
<lifecycle-callbacks> |
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 | |
use Doctrine\ORM\Mapping\ClassMetadataInfo; | |
$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); | |
$metadata->setPrimaryTable(array( | |
'name' => 'cms_users', | |
)); | |
$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); | |
$metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); |
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\Tests\ORM\Mapping\User: | |
type: entity | |
table: cms_users | |
id: | |
id: | |
type: integer | |
generator: | |
strategy: AUTO | |
fields: | |
name: |
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 | |
namespace Doctrine\Tests\ORM\Mapping; | |
/** | |
* @Entity | |
* @HasLifecycleCallbacks | |
* @Table(name="cms_users") | |
*/ | |
class User |
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
class OutputWriter | |
{ | |
private $_closure; | |
public function __construct($closure = null) | |
{ | |
if ($closure === null) { | |
$closure = function($message) {}; | |
} | |
$this->_closure = $closure; |
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
protected function _getMigrationConfiguration(InputInterface $input, OutputInterface $output) | |
{ | |
$outputWriter = new OutputWriter(function($message) use ($output) { | |
return $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
<?xml version="1.0"?> | |
<!-- | |
Doctrine 2 build file. | |
--> | |
<project name="Doctrine2" default="build" basedir="."> | |
<import file="build-dependencies.xml"/> | |
<taskdef classname="NativePhpunitTask" classpath="./tests/" name="nativephpunit" /> |
OlderNewer