Esempio n. 1
0
 /**
  * @param array $ids
  * @param array $expected
  * @dataProvider getIdsDataProvider
  */
 public function testGetIds(array $ids, array $expected)
 {
     $result = new \ArrayIterator($ids);
     $this->_collection->expects($this->once())->method('find')->will($this->returnValue($result));
     $actual = $this->_model->getIds();
     $this->assertEquals($expected, $actual);
 }
Esempio n. 2
0
 public function testCleanOld()
 {
     $this->_model->save('long-living entity', 'long', [], 1000);
     $this->_model->save('infinite-living entity', 'infinite', [], null);
     $this->_model->save('short-living entity', 'short', [], 0);
     $this->_model->clean(\Zend_Cache::CLEANING_MODE_OLD);
     $expectedIds = ['long', 'infinite'];
     $actualIds = $this->_model->getIds();
     $this->assertSame($expectedIds, $actualIds);
 }