public function testMetadataAnnotations()
 {
     $di = $this->_getDI();
     $di['modelsMetadata'] = function () {
         $metaData = new Phalcon\Mvc\Model\Metadata\Memory();
         $metaData->setStrategy(new Phalcon\Mvc\Model\MetaData\Strategy\Annotations());
         return $metaData;
     };
     $metaData = $di['modelsMetadata'];
     $robots = new Boutique\Robots();
     $meta = $metaData->readMetaData($robots);
     $this->assertEquals($meta, $this->_expectedMeta);
     $meta = $metaData->readMetaData($robots);
     $this->assertEquals($meta, $this->_expectedMeta);
 }
Exemplo n.º 2
0
 public function testMetadataAnnotations()
 {
     require 'unit-tests/config.db.php';
     if (empty($configMysql)) {
         $this->markTestSkipped('Test skipped');
         return;
     }
     $di = $this->_getDI();
     $di['modelsMetadata'] = function () {
         $metaData = new Phalcon\Mvc\Model\Metadata\Memory();
         $metaData->setStrategy(new Phalcon\Mvc\Model\MetaData\Strategy\Annotations());
         return $metaData;
     };
     $metaData = $di['modelsMetadata'];
     $robots = new Boutique\Robots();
     $meta = $metaData->readMetaData($robots);
     $this->assertEquals($meta, $this->_expectedMeta);
     $meta = $metaData->readMetaData($robots);
     $this->assertEquals($meta, $this->_expectedMeta);
 }
 public function testMetadataAnnotations()
 {
     require 'unit-tests/config.db.php';
     if (empty($configMysql)) {
         $this->markTestSkipped('Test skipped');
         return;
     }
     $di = $this->_getDI();
     $di['modelsMetadata'] = function () {
         $metaData = new Phalcon\Mvc\Model\Metadata\Memory();
         $metaData->setStrategy(new Phalcon\Mvc\Model\MetaData\Strategy\Annotations());
         return $metaData;
     };
     $metaData = $di['modelsMetadata'];
     $robots = new Boutique\Robots();
     $meta = $metaData->readMetaData($robots);
     $this->assertEquals($meta, $this->_expectedMeta);
     // Issue 2954
     $robot = Boutique\Robotters::findFirst();
     $code = $robot->code;
     $serialized = serialize($robot);
     $unserialized = unserialize($serialized);
     $this->assertEquals($code, $unserialized->code);
 }