Skip to content

Commit

Permalink
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tests/MateCatSubFilteringTest.php
Original file line number Diff line number Diff line change
@@ -691,8 +691,8 @@ public function testXTags()
$l1_segment = $Filter->fromLayer0ToLayer1( $db_segment );
$l2_segment = $Filter->fromLayer1ToLayer2( $l1_segment );

// $this->assertEquals($l1_segment, $expected_l1_segment);
// $this->assertEquals($l2_segment, $expected_l2_segment);
$this->assertEquals($l1_segment, $expected_l1_segment);
$this->assertEquals($l2_segment, $expected_l2_segment);

$back_to_db_segment = $Filter->fromLayer1ToLayer0($l1_segment);

@@ -718,4 +718,23 @@ public function testWithComplexUrls()
$this->assertEquals($back_to_db_segment, $db_segment);

}
}

public function testWithEncodedText()
{
$Filter = MateCatFilter::getInstance( new FeatureSet(), 'en-EN','et-ET', [] );

$db_segment = '<x id="3"/>Primary Care Facilities<x id="7"/>';
$expected_l1_segment = '<ph id="mtc_1" equiv-text="base64:Jmx0O3ggaWQ9IjMiLyZndDs="/>Primary Care Facilities<ph id="mtc_2" equiv-text="base64:Jmx0O3ggaWQ9IjciLyZndDs="/>';
$expected_l2_segment = '&lt;ph id="mtc_1" equiv-text="base64:Jmx0O3ggaWQ9IjMiLyZndDs="/&gt;Primary Care Facilities&lt;ph id="mtc_2" equiv-text="base64:Jmx0O3ggaWQ9IjciLyZndDs="/&gt;';

$l1_segment = $Filter->fromLayer0ToLayer1( $db_segment );
$l2_segment = $Filter->fromLayer1ToLayer2( $l1_segment );

$this->assertEquals($l1_segment, $expected_l1_segment);
$this->assertEquals($l2_segment, $expected_l2_segment);

$back_to_db_segment = $Filter->fromLayer1ToLayer0($l1_segment);

$this->assertEquals($back_to_db_segment, $db_segment);
}
}

0 comments on commit fc4363a

Please sign in to comment.