Esempio n. 1
0
 public function execute()
 {
     if (strlen($this->login) < self::MinLength) {
         throw new InvalidArgumentException('Search key too small');
     }
     $condition = new Request();
     $condition->likeFields = ['login' => $this->login];
     $condition->limit = self::Limit;
     $found = $this->repository->find($condition);
     return $found;
 }
Esempio n. 2
0
 public function testFindWithOffsets()
 {
     $fixture = 'Hello world!';
     $configuration = $this->configurationRepository->read();
     $configuration->fields = ['a' => '\\Extasy\\Model\\Columns\\Input'];
     $this->configurationRepository->write($configuration);
     $data = [new UserAccount(['login' => self::Marie, 'a' => $fixture], $this->configurationRepository), new UserAccount(['login' => self::Elen, 'a' => $fixture], $this->configurationRepository)];
     $this->fixtureUsers($data);
     $condition = new Request();
     $condition->fields = ['a' => $fixture];
     $condition->offset = 1;
     $condition->limit = 1;
     $result = $this->repository->find($condition);
     $this->assertEquals(1, sizeof($result));
     $this->assertEquals(self::Elen, $result[0]->login->getValue());
 }