Skip to:
Content

bbPress.org

Changeset 6048


Ignore:
Timestamp:
06/01/2016 04:05:30 AM (5 years ago)
Author:
netweb
Message:

Tests: Add test_bbp_get_do_not_reply_address() common functions reply email address test

Props thebrandonallen
Fixes #2822

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/common/functions.php

    r5812 r6048  
    712712    /**
    713713     * @covers ::bbp_get_do_not_reply_address
    714      * @todo   Implement test_bbp_get_do_not_reply_address().
    715714     */
    716715    public function test_bbp_get_do_not_reply_address() {
    717         // Remove the following lines when you implement this test.
    718         $this->markTestIncomplete(
    719             'This test has not been implemented yet.'
    720         );
     716
     717        $_SERVER['SERVER_NAME'] = 'example.org';
     718        $address = bbp_get_do_not_reply_address();
     719        $this->assertEquals( 'noreply@example.org', $address );
     720
     721        $_SERVER['SERVER_NAME'] = 'www.example.org';
     722        $address = bbp_get_do_not_reply_address();
     723        $this->assertEquals( 'noreply@example.org', $address );
     724
     725        $_SERVER['SERVER_NAME'] = 'subdomain.example.org';
     726        $address = bbp_get_do_not_reply_address();
     727        $this->assertEquals( 'noreply@subdomain.example.org', $address );
     728
     729        $_SERVER['SERVER_NAME'] = 'www.subdomain.example.org';
     730        $address = bbp_get_do_not_reply_address();
     731        $this->assertEquals( 'noreply@subdomain.example.org', $address );
     732
     733        // Reset server name.
     734        $_SERVER['SERVER_NAME'] = 'example.org';
    721735    }
    722736
Note: See TracChangeset for help on using the changeset viewer.