|
@@ 177-206 (lines=30) @@
|
| 174 |
|
* @test |
| 175 |
|
* @return void |
| 176 |
|
*/ |
| 177 |
|
public function findRecordsForSpecialExcludePageUidTest() |
| 178 |
|
{ |
| 179 |
|
/** @var \DERHANSEN\SfBanners\Domain\Model\BannerDemand $demand */ |
| 180 |
|
$demand = new BannerDemand(); |
| 181 |
|
$pid = 95; |
| 182 |
|
|
| 183 |
|
/* Define PIDs */ |
| 184 |
|
$pid1 = 4; |
| 185 |
|
$pid2 = 5; |
| 186 |
|
$pid3 = 6; |
| 187 |
|
|
| 188 |
|
/* Set starting point */ |
| 189 |
|
$demand->setStartingPoint($pid); |
| 190 |
|
|
| 191 |
|
/* All banners, which not should be shown on the page with $pid1 */ |
| 192 |
|
$demand->setCurrentPageUid($pid1); |
| 193 |
|
$this->assertEquals(1, count($this->bannerRepository->findDemanded($demand))); |
| 194 |
|
|
| 195 |
|
/* All banners, which not should be shown on page with $pid2 */ |
| 196 |
|
$demand->setCurrentPageUid($pid2); |
| 197 |
|
$this->assertEquals(1, count($this->bannerRepository->findDemanded($demand))); |
| 198 |
|
|
| 199 |
|
/* All banners, which not should be shown on page with $pid3 */ |
| 200 |
|
$demand->setCurrentPageUid($pid3); |
| 201 |
|
$this->assertEquals(2, count($this->bannerRepository->findDemanded($demand))); |
| 202 |
|
|
| 203 |
|
/* All banners, which not should be shown on page with a non existing pid */ |
| 204 |
|
$demand->setCurrentPageUid(999); |
| 205 |
|
$this->assertEquals(3, count($this->bannerRepository->findDemanded($demand))); |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
/** |
| 209 |
|
* Test if records are not returned on pages recursively where they not should be shown |
|
@@ 214-244 (lines=31) @@
|
| 211 |
|
* @test |
| 212 |
|
* @return void |
| 213 |
|
*/ |
| 214 |
|
public function findRecordsForSpecialExcludeRecursivePageUidTest() |
| 215 |
|
{ |
| 216 |
|
/** @var \DERHANSEN\SfBanners\Domain\Model\BannerDemand $demand */ |
| 217 |
|
$demand = new BannerDemand(); |
| 218 |
|
$pid = 96; |
| 219 |
|
|
| 220 |
|
/* Define PIDs */ |
| 221 |
|
$pid1 = 7; |
| 222 |
|
$pid2 = 8; |
| 223 |
|
$pid3 = 9; |
| 224 |
|
$pid4 = 10; |
| 225 |
|
|
| 226 |
|
/* Set starting point */ |
| 227 |
|
$demand->setStartingPoint($pid); |
| 228 |
|
|
| 229 |
|
/* All banners, which not should be shown on the page with $pid1 */ |
| 230 |
|
$demand->setCurrentPageUid($pid1); |
| 231 |
|
$this->assertEquals(2, count($this->bannerRepository->findDemanded($demand))); |
| 232 |
|
|
| 233 |
|
/* All banners, which not should be shown on page with $pid2 */ |
| 234 |
|
$demand->setCurrentPageUid($pid2); |
| 235 |
|
$this->assertEquals(1, count($this->bannerRepository->findDemanded($demand))); |
| 236 |
|
|
| 237 |
|
/* All banners, which not should be shown on page with $pid3 */ |
| 238 |
|
$demand->setCurrentPageUid($pid3); |
| 239 |
|
$this->assertEquals(0, count($this->bannerRepository->findDemanded($demand))); |
| 240 |
|
|
| 241 |
|
/* All banners, which not should be shown on page with $pid4 */ |
| 242 |
|
$demand->setCurrentPageUid($pid4); |
| 243 |
|
$this->assertEquals(2, count($this->bannerRepository->findDemanded($demand))); |
| 244 |
|
} |
| 245 |
|
|
| 246 |
|
/** |
| 247 |
|
* Test if records are not returned, if max impressions reached |