Пример #1
0
 /**
  * @test
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function valueObjectsDontTriggerDirtyObject()
 {
     $repository = $this->objectManager->get('TYPO3\\CouchDB\\Tests\\Functional\\Fixtures\\Domain\\Repository\\TestEntityRepository');
     $entity = new \TYPO3\CouchDB\Tests\Functional\Fixtures\Domain\Model\TestEntity();
     $entity->setName('Entity with single valueobject');
     $relatedValueObject = new \TYPO3\CouchDB\Tests\Functional\Fixtures\Domain\Model\TestValueObject('Red');
     $entity->setRelatedValueObject($relatedValueObject);
     $repository->add($entity);
     $this->tearDown();
     $object = $repository->findOneByName('Entity with single valueobject');
     $metadata = $object->Flow_Persistence_Metadata;
     $revision = $metadata['CouchDB_Revision'];
     $this->tearDown();
     $object = $repository->findOneByName('Entity with single valueobject');
     $metadata = $object->Flow_Persistence_Metadata;
     $newRevision = $metadata['CouchDB_Revision'];
     $this->assertEquals($revision, $newRevision);
 }
Пример #2
0
 /**
  * Larger documents are transferred differently from CouchDB Lucene, so the
  * HttpConnector had a bug with wrong handling of chunked transfer.
  *
  * @test
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function chunkedDataIsTransferredCorrectly()
 {
     $repository = $this->objectManager->get('TYPO3\\CouchDB\\Tests\\Functional\\Fixtures\\Domain\\Repository\\TestEntityRepository');
     $entity = new \TYPO3\CouchDB\Tests\Functional\Fixtures\Domain\Model\TestEntity();
     $entity->setName(str_repeat('Some entity-', 2000));
     $entity->setRelatedValueObject(new Fixtures\Domain\Model\TestValueObject('green'));
     $repository->add($entity);
     $persistenceManager = $this->objectManager->get('TYPO3\\Flow\\Persistence\\PersistenceManagerInterface');
     $persistenceManager->persistAll();
     $persistenceSession = $this->objectManager->get('TYPO3\\Flow\\Persistence\\Generic\\Session');
     $persistenceSession->destroy();
     $entities = $repository->findByColor('green')->toArray();
     $this->assertEquals(1, count($entities));
 }