Title: How test admin content in PHPUnit
Last modified: October 2, 2021

---

# How test admin content in PHPUnit

 *  [notconnected](https://wordpress.org/support/users/notconnected/)
 * (@notconnected)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/how-test-admin-content-in-phpunit/)
 * Hi all.
 * How I can test the html-content of my plugin in wp-admin with PHPUnit tests.
   
   I want something like this:
 *     ```
       set_current_screen('admin_page_myplugin');
       $html = $this->getOriginalHTML();
       $this->assertContains('My plugin unique content', $html);
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [notconnected](https://wordpress.org/support/users/notconnected/)
 * (@notconnected)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/how-test-admin-content-in-phpunit/#post-14959744)
 * I do it by cURL.

Viewing 1 replies (of 1 total)

The topic ‘How test admin content in PHPUnit’ is closed to new replies.

## Tags

 * [phpunit](https://wordpress.org/support/topic-tag/phpunit/)
 * [tests](https://wordpress.org/support/topic-tag/tests/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 3 participants
 * Last reply from: [notconnected](https://wordpress.org/support/users/notconnected/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/how-test-admin-content-in-phpunit/#post-14959744)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
