AZ_Shortcode_Tests::test_populated_listing()


Description


Source

File: tests/test-shortcode.php

	function test_populated_listing() {
		$title = 'Test Page';
		$p = $this->factory->post->create( array(
			'post_title' => $title,
			'post_type' => 'page',
		) );

		$expected = sprintf( file_get_contents( 'tests/populated-listing.txt' ), $title, $p );
		$actual = do_shortcode( '[a-z-listing]' );

		$expected = preg_replace( '/\s{2,}|\t|\n/', '', $expected );
		$actual = preg_replace( '/\s{2,}|\t|\n/', '', $actual );
		$this->assertEquals( $expected, $actual );
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.

This site uses Akismet to reduce spam. Learn how your comment data is processed.