Make WordPress Core


Ignore:
Timestamp:
05/19/2014 01:16:16 AM (10 years ago)
Author:
wonderboymusic
Message:

Add access modifiers to methods and members of list table classes:

  • WP_List_Table is the base class that implements __get() and __call() for BC
  • Adds unit tests to confirm that subclasses properly inherit magic methods
  • Add modifiers to subclasses: WP_Links_List_Table, WP_Media_List_Table, WP_MS_Sites_List_Table, WP_MS_Themes_List_Table, WP_MS_Users_List_Table, WP_Plugin_Install_List_Table, WP_Plugins_List_Table, WP_Posts_List_Table, WP_Terms_List_Table, WP_Theme_Install_List_Table, WP_Themes_List_Table

See #27881, #22234.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/basic.php

    r28480 r28493  
    128128        $this->assertEquals( 'bar', $basic->foo );
    129129    }
     130
     131    function test_subclass_magic_getter() {
     132        $basic = new Basic_Subclass();
     133
     134        $this->assertEquals( 'bar', $basic->foo );
     135    }
     136
     137    function test_call_method() {
     138        $basic = new Basic_Object();
     139
     140        $this->assertEquals( 'maybe', $basic->callMe() );
     141    }
     142
     143    function test_subclass_call_method() {
     144        $basic = new Basic_Subclass();
     145
     146        $this->assertEquals( 'maybe', $basic->callMe() );
     147    }
    130148}
Note: See TracChangeset for help on using the changeset viewer.