[ Index ] |
PHP Cross Reference of GlotPress |
[Summary view] [Print] [Text view]
1 <?php 2 3 class GP_Test_Template_Functions extends GP_UnitTestCase { 4 5 function tearDown() { 6 parent::tearDown(); 7 remove_all_filters('gp_breadcrumb_items'); 8 } 9 10 function test_gp_breadcrumb_should_return_empty_string_without_params() { 11 $this->assertEquals( '', gp_breadcrumb() ); 12 } 13 14 function test_gp_breadcrumb_should_run_empty_string_through_filter_without_params() { 15 $filter = $this->getMockBuilder('stdClass')->setMethods(array('breadcrumb_filter'))->getMock(); 16 $filter->expects( $this->once() )->method( 'breadcrumb_filter' )->with( $this->equalTo( array() ) ); 17 18 add_filter( 'gp_breadcrumb_items', array( $filter, 'breadcrumb_filter') ); 19 gp_breadcrumb(); 20 remove_filter( 'gp_breadcrumb_items', array( $filter, 'breadcrumb_filter') ); 21 } 22 23 function test_gp_breadcrumb_should_display_default_list() { 24 gp_breadcrumb( array( 'baba', 'dyado') ); 25 $this->assertEquals( '<ul class="breadcrumb"><li>baba</li><li>dyado</li></ul>', gp_breadcrumb() ); 26 } 27 28 function test_gp_breadcrumb_should_join_all_crumbs() { 29 gp_breadcrumb( array( 'baba', 'dyado') ); 30 $this->assertEquals( 'babadyado', gp_breadcrumb( null, array( 'before' => '', 'after' => '', 'breadcrumb-template' => '{breadcrumb}' ) ) ); 31 } 32 33 function test_gp_breadcrumb_should_use_the_before_argument() { 34 gp_breadcrumb( array( 'baba', 'dyado') ); 35 $this->assertEquals( '---baba---dyado', gp_breadcrumb( null, array( 'before' => '---', 'after' => '', 'breadcrumb-template' => '{breadcrumb}' ) ) ); 36 } 37 38 function test_gp_breadcrumb_should_flatten_the_given_array_of_crumbs() { 39 gp_breadcrumb( array( 'baba', array( 'dyado' ), 'muu' ) ); 40 $this->assertEquals( 'babadyadomuu', gp_breadcrumb( null, array( 'before' => '', 'after' => '', 'breadcrumb-template' => '{breadcrumb}' ) ) ); 41 42 } 43 44 function test_gp_get_translation_row_classes() { 45 $entry = new Translation_Entry ( array( 'singular' => 'ganoush', 'warnings' => null, 'priority'=> '1', 'translation_status' =>'untranslated' ) ); 46 $this->assertEquals( array( 'status-untranslated', 'no-warnings', 'priority-high', 'no-translations' ), gp_get_translation_row_classes( $entry ), '', 0.0, 10, true ); 47 } 48 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Nov 21 01:01:07 2024 | Cross-referenced by PHPXref 0.7.1 |