-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Changed ezstring data provider * Added ElementAttributeMapper * Added timeout setting * Added Taxonomy suites
- Loading branch information
Showing
10 changed files
with
126 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Behat\Browser\Element\Mapper; | ||
|
||
use Ibexa\Behat\Browser\Element\ElementInterface; | ||
|
||
class ElementAttributeMapper implements MapperInterface | ||
{ | ||
private string $attribute; | ||
|
||
public function __construct(string $attribute) | ||
{ | ||
$this->attribute = $attribute; | ||
} | ||
|
||
public function map(ElementInterface $element): string | ||
{ | ||
return $element->getAttribute($this->attribute); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/lib/Browser/Element/Mapper/ElementAttributeMapperTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Tests\Behat\Browser\Element\Mapper; | ||
|
||
use Ibexa\Behat\Browser\Element\ElementInterface; | ||
use Ibexa\Behat\Browser\Element\Mapper\ElementAttributeMapper; | ||
use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; | ||
use PHPUnit\Framework\Assert; | ||
|
||
class ElementAttributeMapperTest extends BaseTestCase | ||
{ | ||
private ElementAttributeMapper $mapper; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->mapper = new ElementAttributeMapper('data-id'); | ||
} | ||
|
||
public function testMapsSingleElement(): void | ||
{ | ||
$element = $this->createStub(ElementInterface::class); | ||
$element->method('getAttribute')->willReturn('AttributeValue'); | ||
|
||
Assert::assertEquals('AttributeValue', $this->mapper->map($element)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters