MediaWiki  master
PagePropsTest Class Reference

PageProps. More...

Inheritance diagram for PagePropsTest:
Collaboration diagram for PagePropsTest:

Public Member Functions

 testClearCache ()
 Test that getting all properties clears the single properties that have been cached by getting a property, saving a new value for the property, getting all properties (which clears the cached single properties), then getting the property again. More...
 
 testGetAllProperties ()
 Test getting all properties from a single page. More...
 
 testGetAllPropertiesMultiplePages ()
 Test getting all properties from multiple pages. More...
 
 testGetMultiplePropertiesMultiplePages ()
 Test getting multiple properties from multiple pages. More...
 
 testGetSingleProperty ()
 Test getting a single property from a single page. More...
 
 testGetSinglePropertyMultiplePages ()
 Test getting a single property from multiple pages. More...
 
 testMultiCache ()
 Test caching when retrieving all properties by getting all properties, saving a new value for a property, then getting all properties again. More...
 
 testSingleCache ()
 Test caching when retrieving single properties by getting a property, saving a new value for the property, then getting the property again. More...
 

Protected Member Functions

 createPage ( $page, $text, $model=null)
 
 setProperties ( $pageID, $properties)
 
 setProperty ( $pageID, $propertyName, $propertyValue)
 
 setUp ()
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 

Private Attributes

 $the_properties
 
 $title1
 
 $title2
 

Detailed Description

PageProps.

Database ^— tell jenkins this test needs the database

medium ^— tell phpunit that these test cases may take longer than 2 seconds.

Definition at line 14 of file PagePropsTest.php.

Member Function Documentation

◆ createPage()

PagePropsTest::createPage (   $page,
  $text,
  $model = null 
)
protected

◆ setProperties()

PagePropsTest::setProperties (   $pageID,
  $properties 
)
protected

Definition at line 260 of file PagePropsTest.php.

References $rows, as, DB_MASTER, and wfGetDB().

Referenced by setProperty(), and setUp().

◆ setProperty()

PagePropsTest::setProperty (   $pageID,
  $propertyName,
  $propertyValue 
)
protected

Definition at line 287 of file PagePropsTest.php.

References setProperties().

Referenced by testClearCache(), testMultiCache(), and testSingleCache().

◆ setUp()

PagePropsTest::setUp ( )
protected

Definition at line 31 of file PagePropsTest.php.

References CONTENT_MODEL_WIKITEXT, createPage(), and setProperties().

◆ testClearCache()

PagePropsTest::testClearCache ( )

Test that getting all properties clears the single properties that have been cached by getting a property, saving a new value for the property, getting all properties (which clears the cached single properties), then getting the property again.

The new value for the property rather than the cached value of the property should be returned.

Definition at line 221 of file PagePropsTest.php.

References PageProps\getInstance(), and setProperty().

◆ testGetAllProperties()

PagePropsTest::testGetAllProperties ( )

Test getting all properties from a single page.

The properties were set in setUp(). The properties retrieved from the page may include additional properties not set in the test case that are added by other extensions. Therefore, rather than checking to see if the properties that were set in the test case exactly match the retrieved properties, we need to check to see if they are a subset of the retrieved properties. Since this version of PHPUnit does not yet include assertArraySubset(), we needed to code the equivalent functionality.

Definition at line 150 of file PagePropsTest.php.

References PageProps\getInstance().

◆ testGetAllPropertiesMultiplePages()

PagePropsTest::testGetAllPropertiesMultiplePages ( )

Test getting all properties from multiple pages.

The properties were set in setUp(). See getAllProperties() above for more information.

Definition at line 164 of file PagePropsTest.php.

References $title1, $title2, $titles, and PageProps\getInstance().

◆ testGetMultiplePropertiesMultiplePages()

PagePropsTest::testGetMultiplePropertiesMultiplePages ( )

Test getting multiple properties from multiple pages.

The properties were set in setUp().

Definition at line 114 of file PagePropsTest.php.

References $title1, $title2, $titles, and PageProps\getInstance().

◆ testGetSingleProperty()

PagePropsTest::testGetSingleProperty ( )

Test getting a single property from a single page.

The property was set in setUp().

Definition at line 83 of file PagePropsTest.php.

References PageProps\getInstance().

◆ testGetSinglePropertyMultiplePages()

PagePropsTest::testGetSinglePropertyMultiplePages ( )

Test getting a single property from multiple pages.

The property was set in setUp().

Definition at line 95 of file PagePropsTest.php.

References $title1, $title2, $titles, and PageProps\getInstance().

◆ testMultiCache()

PagePropsTest::testMultiCache ( )

Test caching when retrieving all properties by getting all properties, saving a new value for a property, then getting all properties again.

The cached value for the properties rather than the new value of the properties should be returned.

Definition at line 204 of file PagePropsTest.php.

References PageProps\getInstance(), and setProperty().

◆ testSingleCache()

PagePropsTest::testSingleCache ( )

Test caching when retrieving single properties by getting a property, saving a new value for the property, then getting the property again.

The cached value for the property rather than the new value of the property should be returned.

Definition at line 189 of file PagePropsTest.php.

References PageProps\getInstance(), and setProperty().

Member Data Documentation

◆ $the_properties

array PagePropsTest::$the_properties
private

Definition at line 29 of file PagePropsTest.php.

◆ $title1

◆ $title2


The documentation for this class was generated from the following file: