| | 372 | |
| | 373 | /** |
| | 374 | * @ticket 10935 |
| | 375 | */ |
| | 376 | function test_query_is_date() { |
| | 377 | $this->q->query( array( |
| | 378 | 'year' => '2007', |
| | 379 | 'monthnum' => '01', |
| | 380 | 'day' => '01', |
| | 381 | ) ); |
| | 382 | |
| | 383 | $this->assertTrue( $this->q->is_date ); |
| | 384 | $this->assertTrue( $this->q->is_day ); |
| | 385 | $this->assertFalse( $this->q->is_month ); |
| | 386 | $this->assertFalse( $this->q->is_year ); |
| | 387 | |
| | 388 | $this->q->query( array( |
| | 389 | 'year' => '2007', |
| | 390 | 'monthnum' => '01', |
| | 391 | ) ); |
| | 392 | |
| | 393 | $this->assertTrue( $this->q->is_date ); |
| | 394 | $this->assertFalse( $this->q->is_day ); |
| | 395 | $this->assertTrue( $this->q->is_month ); |
| | 396 | $this->assertFalse( $this->q->is_year ); |
| | 397 | |
| | 398 | $this->q->query( array( |
| | 399 | 'year' => '2007', |
| | 400 | ) ); |
| | 401 | |
| | 402 | $this->assertTrue( $this->q->is_date ); |
| | 403 | $this->assertFalse( $this->q->is_day ); |
| | 404 | $this->assertFalse( $this->q->is_month ); |
| | 405 | $this->assertTrue( $this->q->is_year ); |
| | 406 | |
| | 407 | $this->q->query( array( |
| | 408 | 'year' => '2007', |
| | 409 | 'monthnum' => '01', |
| | 410 | 'day' => '50', |
| | 411 | ) ); |
| | 412 | |
| | 413 | $this->assertTrue( $this->q->is_404 ); |
| | 414 | $this->assertFalse( $this->q->is_date ); |
| | 415 | $this->assertFalse( $this->q->is_day ); |
| | 416 | $this->assertFalse( $this->q->is_month ); |
| | 417 | $this->assertFalse( $this->q->is_year ); |
| | 418 | } |