Skip to content
Snippets Groups Projects
Select Git revision
  • 8f22d9a79b503bc611b34f65d724fca95baa1926
  • master default protected
  • bugfix/wordpress-review
  • fix/duplicate
  • bugfix/get_current_screen_fail
  • feature/dismiss-nonce
  • replace-dodgy-path
  • bugfix/notice-not-show
  • devel
  • 3.3.0
  • 3.2.5
  • 3.2.4
  • 3.2.3
  • 3.2.2
  • 3.2.1
  • 3.2.0
  • 3.2.0-beta7
  • 3.2.0-beta6
  • 3.2.0-beta5
  • 3.2.0-beta4
  • 3.2.0-beta3
  • 3.2.0-beta2
  • 3.2.0-beta1
  • 3.1.4
  • 3.1.4-beta1
  • 3.1.3
  • 3.1.1
  • 3.1
  • 3.0
29 results

TestFunctions.php

Blame
  • TestFunctions.php 2.77 KiB
    <?php
    
    use \WPDesk\Notice\Notice;
    use \WPDesk\Notice\PermanentDismissibleNotice;
    
    /**
     * Class TestFunctions
     */
    class TestFunctions extends WP_UnitTestCase
    {
    
        /**
         * Test WPDeskNotice function.
         */
        public function testWPDeskNotice()
        {
            $notice = wpdesk_notice('test function');
    
            $this->assertInstanceOf(Notice::class, $notice);
    
            $this->expectOutputString('<div class="notice notice-info"><p>test function</p></div>');
    
            $notice->showNotice();
        }
    
        /**
         * Test WPDeskNoticeInfo function.
         */
        public function testWPDeskNoticeInfo()
        {
            $notice = wpdesk_notice_info('test function');
    
            $this->assertInstanceOf(Notice::class, $notice);
    
            $this->expectOutputString('<div class="notice notice-info"><p>test function</p></div>');
    
            $notice->showNotice();
        }
    
        /**
         * Test WPDeskNoticeError function.
         */
        public function testWPDeskNoticeError()
        {
            $notice = wpdesk_notice_error('test function');
    
            $this->assertInstanceOf(Notice::class, $notice);
    
            $this->expectOutputString('<div class="notice notice-error"><p>test function</p></div>');
    
            $notice->showNotice();
        }
    
        /**
         * Test WPDeskNoticeWarning function.
         */
        public function testWPDeskNoticeWarning()
        {
            $notice = wpdesk_notice_warning('test function');
    
            $this->assertInstanceOf(Notice::class, $notice);
    
            $this->expectOutputString('<div class="notice notice-warning"><p>test function</p></div>');
    
            $notice->showNotice();
        }
    
        /**
         * Test WPDeskNoticeSuccess function.
         */