Ejemplo n.º 1
0
 /**
  * @test
  */
 public function findAllSectionThatMatchCertainCriteria()
 {
     $this->obj->flush();
     $section = new Section();
     $section->id = 17;
     $section->volume = 1;
     $section->title = "Chapter 17";
     $section->page = 17;
     $section->level = 3;
     $section->element = 'div';
     $this->obj->save($section);
     $section = new Section();
     $section->id = 23;
     $section->volume = 2;
     $section->title = "Chapter 23";
     $section->page = 180;
     $section->level = 2;
     $section->element = 'div';
     $this->obj->save($section);
     $objs = $this->obj->find('id = 23');
     $this->assertInternalType('array', $objs);
     $this->assertSame(1, count($objs));
     $this->assertEquals(2, $objs[0]->volume);
     $objs = $this->obj->find('title = Chapter');
     $this->assertInternalType('array', $objs);
     $this->assertSame(0, count($objs));
     $objs = $this->obj->find('title~ Chapter%');
     $this->assertInternalType('array', $objs);
     $this->assertSame(2, count($objs));
     $objs = $this->obj->find('page >= 17');
     $this->assertInternalType('array', $objs);
     $this->assertSame(2, count($objs));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 protected function preProcessAction()
 {
     $this->volumeGateway->flush($this->setup);
     $this->sectionGateway->flush($this->setup);
     $this->pageGateway->flush($this->setup);
     $this->xmlChunkGateway->flush($this->setup);
 }