Changeset 48937 for trunk/tests/phpunit/tests/category.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/category.php
r47122 r48937 30 30 // Validate length is 1 + created due to uncategorized. 31 31 $cat_ids = get_all_category_ids(); 32 $this->assert Equals( 3, count( $cat_ids ) );32 $this->assertSame( 3, count( $cat_ids ) ); 33 33 } 34 34 … … 54 54 // Validate category is returned by slug. 55 55 $ret_testcat = get_category_by_slug( 'testcat' ); 56 $this->assert Equals( $testcat->term_id, $ret_testcat->term_id );56 $this->assertSame( $testcat->term_id, $ret_testcat->term_id ); 57 57 $ret_testcat = get_category_by_slug( 'TeStCaT' ); 58 $this->assert Equals( $testcat->term_id, $ret_testcat->term_id );58 $this->assertSame( $testcat->term_id, $ret_testcat->term_id ); 59 59 60 60 // Validate unknown category returns false. … … 108 108 109 109 // Validate compatibility object. 110 $this->assert Equals( $testcat->cat_ID, $testcat->term_id );111 $this->assert Equals( $testcat->category_count, $testcat->count );112 $this->assert Equals( $testcat->category_description, $testcat->description );113 $this->assert Equals( $testcat->cat_name, $testcat->name );114 $this->assert Equals( $testcat->category_nicename, $testcat->slug );115 $this->assert Equals( $testcat->category_parent, $testcat->parent );110 $this->assertSame( $testcat->cat_ID, $testcat->term_id ); 111 $this->assertSame( $testcat->category_count, $testcat->count ); 112 $this->assertSame( $testcat->category_description, $testcat->description ); 113 $this->assertSame( $testcat->cat_name, $testcat->name ); 114 $this->assertSame( $testcat->category_nicename, $testcat->slug ); 115 $this->assertSame( $testcat->category_parent, $testcat->parent ); 116 116 117 117 // Validate compatibility object with parent. 118 $this->assert Equals( $testcat->cat_ID, $testcat->term_id );119 $this->assert Equals( $testcat->category_count, $testcat->count );120 $this->assert Equals( $testcat->category_description, $testcat->description );121 $this->assert Equals( $testcat->cat_name, $testcat->name );122 $this->assert Equals( $testcat->category_nicename, $testcat->slug );123 $this->assert Equals( $testcat->category_parent, $testcat->parent );118 $this->assertSame( $testcat->cat_ID, $testcat->term_id ); 119 $this->assertSame( $testcat->category_count, $testcat->count ); 120 $this->assertSame( $testcat->category_description, $testcat->description ); 121 $this->assertSame( $testcat->cat_name, $testcat->name ); 122 $this->assertSame( $testcat->category_nicename, $testcat->slug ); 123 $this->assertSame( $testcat->category_parent, $testcat->parent ); 124 124 125 125 // Validate compatibility array. 126 $this->assert Equals( $testcat_array['cat_ID'], $testcat_array['term_id'] );127 $this->assert Equals( $testcat_array['category_count'], $testcat_array['count'] );128 $this->assert Equals( $testcat_array['category_description'], $testcat_array['description'] );129 $this->assert Equals( $testcat_array['cat_name'], $testcat_array['name'] );130 $this->assert Equals( $testcat_array['category_nicename'], $testcat_array['slug'] );131 $this->assert Equals( $testcat_array['category_parent'], $testcat_array['parent'] );126 $this->assertSame( $testcat_array['cat_ID'], $testcat_array['term_id'] ); 127 $this->assertSame( $testcat_array['category_count'], $testcat_array['count'] ); 128 $this->assertSame( $testcat_array['category_description'], $testcat_array['description'] ); 129 $this->assertSame( $testcat_array['cat_name'], $testcat_array['name'] ); 130 $this->assertSame( $testcat_array['category_nicename'], $testcat_array['slug'] ); 131 $this->assertSame( $testcat_array['category_parent'], $testcat_array['parent'] ); 132 132 133 133 // Validate compatibility array with parent. 134 $this->assert Equals( $testcat_array['cat_ID'], $testcat_array['term_id'] );135 $this->assert Equals( $testcat_array['category_count'], $testcat_array['count'] );136 $this->assert Equals( $testcat_array['category_description'], $testcat_array['description'] );137 $this->assert Equals( $testcat_array['cat_name'], $testcat_array['name'] );138 $this->assert Equals( $testcat_array['category_nicename'], $testcat_array['slug'] );139 $this->assert Equals( $testcat_array['category_parent'], $testcat_array['parent'] );134 $this->assertSame( $testcat_array['cat_ID'], $testcat_array['term_id'] ); 135 $this->assertSame( $testcat_array['category_count'], $testcat_array['count'] ); 136 $this->assertSame( $testcat_array['category_description'], $testcat_array['description'] ); 137 $this->assertSame( $testcat_array['cat_name'], $testcat_array['name'] ); 138 $this->assertSame( $testcat_array['category_nicename'], $testcat_array['slug'] ); 139 $this->assertSame( $testcat_array['category_parent'], $testcat_array['parent'] ); 140 140 } 141 141 … … 154 154 155 155 // Validate. 156 $this->assert Equals( $testcat->name, get_cat_name( $testcat->term_id ) );157 $this->assert Equals( '', get_cat_name( -1 ) );158 $this->assert Equals( '', get_cat_name( $testcat->term_id + 100 ) );156 $this->assertSame( $testcat->name, get_cat_name( $testcat->term_id ) ); 157 $this->assertSame( '', get_cat_name( -1 ) ); 158 $this->assertSame( '', get_cat_name( $testcat->term_id + 100 ) ); 159 159 160 160 } … … 174 174 175 175 // Validate. 176 $this->assert Equals( $testcat->term_id, get_cat_ID( $testcat->name ) );177 $this->assert Equals( 0, get_cat_ID( 'NO CAT' ) );178 $this->assert Equals( 0, get_cat_ID( 12 ) );176 $this->assertSame( $testcat->term_id, get_cat_ID( $testcat->name ) ); 177 $this->assertSame( 0, get_cat_ID( 'NO CAT' ) ); 178 $this->assertSame( 0, get_cat_ID( 12 ) ); 179 179 180 180 } … … 230 230 // Validate full match. 231 231 $ret_cat = get_category_by_path( '/root/level-1', true ); 232 $this->assert Equals( $root_level_id, $ret_cat->term_id );232 $this->assertSame( $root_level_id, $ret_cat->term_id ); 233 233 $this->assertNull( get_category_by_path( 'level-1', true ) ); 234 234 $this->assertNull( get_category_by_path( 'nocat/nocat/', true ) ); … … 236 236 // Validate partial match. 237 237 $ret_cat = get_category_by_path( 'level-1', false ); 238 $this->assert Equals( $root_level_id, $ret_cat->term_id );238 $this->assertSame( $root_level_id, $ret_cat->term_id ); 239 239 $ret_cat = get_category_by_path( 'root/cat/level-1', false ); 240 $this->assert Equals( $root_level_id, $ret_cat->term_id );240 $this->assertSame( $root_level_id, $ret_cat->term_id ); 241 241 $ret_cat = get_category_by_path( 'root$2Fcat%20%2Flevel-1', false ); 242 $this->assert Equals( $root_level_id, $ret_cat->term_id );242 $this->assertSame( $root_level_id, $ret_cat->term_id ); 243 243 $this->assertNull( get_category_by_path( 'nocat/nocat/', false ) ); 244 244 }
Note: See TracChangeset
for help on using the changeset viewer.