Make WordPress Core

Ticket #30970: 30970-tests.patch

File 30970-tests.patch, 813 bytes (added by mordauk, 11 years ago)
  • tests/phpunit/tests/query/setupPostdata.php

     
    4646                $this->assertSame( $p->ID, $GLOBALS['id'] );
    4747        }
    4848
     49        public function test_setup_by_id() {
     50                $p = $this->factory->post->create_and_get();
     51                setup_postdata( $p->ID );
     52
     53                $this->assertNotEmpty( $p->ID );
     54                $this->assertSame( $p->ID, $GLOBALS['id'] );
     55        }
     56
     57        public function test_fake_post() {
     58
     59                $fake = new stdClass;
     60                $fake->ID = 100;
     61
     62                $this->assertNotSame( $fake->ID, $GLOBALS['id'] );
     63        }
     64
    4965        public function test_authordata() {
    5066                $u = $this->factory->user->create_and_get();
    5167                $p = $this->factory->post->create_and_get( array(