Skip to content

Commit

Permalink
Merge pull request #35 from matecat/remove-singlecurlybracketstoph
Browse files Browse the repository at this point in the history
Removed `SingleCurlyBracketsToPh` from Uber pipeline
  • Loading branch information
mauretto78 authored Jul 26, 2023
2 parents 854143f + cf0d211 commit 0d451eb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 49 deletions.
5 changes: 0 additions & 5 deletions src/MyMemoryFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Matecat\SubFiltering\Filters\RestoreXliffTagsContent;
use Matecat\SubFiltering\Filters\RestoreXliffTagsInXliff;
use Matecat\SubFiltering\Filters\RubyOnRailsI18n;
use Matecat\SubFiltering\Filters\SingleCurlyBracketsToPh;
use Matecat\SubFiltering\Filters\SmartCounts;
use Matecat\SubFiltering\Filters\Snails;
use Matecat\SubFiltering\Filters\SplitPlaceholder;
Expand Down Expand Up @@ -86,10 +85,6 @@ public function fromLayer0ToLayer1( $segment, $cid = null ) {
$channel->addLast( new RestoreXliffTagsContent() );
$channel->addLast( new RestorePlaceHoldersToXLIFFLtGt() );

if ( $cid == 'uber' ) {
$channel->addAfter( new TwigToPh(), new SingleCurlyBracketsToPh() );
}

return $channel->transform( $segment );

}
Expand Down
16 changes: 0 additions & 16 deletions tests/MateCatSubFilteringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Matecat\SubFiltering\Filters\TwigToPh;
use Matecat\SubFiltering\MateCatFilter;
use Matecat\SubFiltering\Tests\Mocks\Features\AirbnbFeature;
use Matecat\SubFiltering\Tests\Mocks\Features\UberFeature;
use Matecat\SubFiltering\Tests\Mocks\FeatureSet;
use Matecat\SubFiltering\Utils\CatUtils;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -783,21 +782,6 @@ public function testSmartCount() {
**************************
*/

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

$db_segment = 'Ciao questo è una prova {RIDER}. { RIDER } non viene bloccato.';
$expected_l1_segment = 'Ciao questo è una prova <ph id="mtc_1" ctype="' . CTypeEnum::CURLY_BRACKETS . '" equiv-text="base64:e1JJREVSfQ=="/>. { RIDER } non viene bloccato.';

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

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

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

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

/**
* Test for skyscanner
* (promoted to global behavior)
Expand Down
26 changes: 0 additions & 26 deletions tests/Mocks/Features/UberFeature.php

This file was deleted.

2 changes: 0 additions & 2 deletions tests/MyMemorySubFilteringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,8 @@ public function testWithSquareSprintf() {
'[%.222f:name]',
'[%.2f:placeholder]',
'[%.2f:place_holder]',
'[%key_id:key_id%]',
'[%key_id:1234%]',
'[%test:1234%]',
'[%test:test%]',
];

foreach ($tags as $tag){
Expand Down

0 comments on commit 0d451eb

Please sign in to comment.