Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deguif committed Oct 21, 2021
1 parent 835fd1c commit 1d3fb91
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Processor/LowercaseProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ public function testLowercase(): void
$this->assertEquals($expected, $processor->toArray());
}

/**
* @group unit
*/
public function testTrimWithNonDefaultOptions(): void
{
$processor = (new LowercaseProcessor('foo'))
->setIgnoreMissing(true)
;

$expected = [
'lowercase' => [
'field' => 'foo',
'ignore_missing' => true,
],
];

$this->assertEquals($expected, $processor->toArray());
}

/**
* @group functional
*/
Expand Down
19 changes: 19 additions & 0 deletions tests/Processor/RemoveProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ public function testRemove(): void
$this->assertEquals($expected, $processor->toArray());
}

/**
* @group unit
*/
public function testTrimWithNonDefaultOptions(): void
{
$processor = (new RemoveProcessor('foo'))
->setIgnoreMissing(true)
;

$expected = [
'remove' => [
'field' => 'foo',
'ignore_missing' => true,
],
];

$this->assertEquals($expected, $processor->toArray());
}

/**
* @group unit
*/
Expand Down
19 changes: 19 additions & 0 deletions tests/Processor/TrimProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ public function testTrim(): void
$this->assertEquals($expected, $processor->toArray());
}

/**
* @group unit
*/
public function testTrimWithNonDefaultOptions(): void
{
$processor = (new TrimProcessor('foo'))
->setIgnoreMissing(true)
;

$expected = [
'trim' => [
'field' => 'foo',
'ignore_missing' => true,
],
];

$this->assertEquals($expected, $processor->toArray());
}

/**
* @group functional
*/
Expand Down
19 changes: 19 additions & 0 deletions tests/Processor/UppercaseProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ public function testUppercase(): void
$this->assertEquals($expected, $processor->toArray());
}

/**
* @group unit
*/
public function testTrimWithNonDefaultOptions(): void
{
$processor = (new UppercaseProcessor('foo'))
->setIgnoreMissing(true)
;

$expected = [
'uppercase' => [
'field' => 'foo',
'ignore_missing' => true,
],
];

$this->assertEquals($expected, $processor->toArray());
}

/**
* @group functional
*/
Expand Down

0 comments on commit 1d3fb91

Please sign in to comment.