Completed
Push — master ( ec5411...629401 )
by Kamil
31:49 queued 16:57
created

TopBarElement::hasAvatarInMainBar()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Behat\Element\Admin;
15
16
use FriendsOfBehat\PageObjectExtension\Element\Element;
17
18
final class TopBarElement extends Element implements TopBarElementInterface
19
{
20
    public function hasAvatarInMainBar(string $avatarPath): bool
21
    {
22
        $image = $this->getDocument()->find('css', 'img.ui.avatar.image');
23
24
        if (null === $image) {
25
            return false;
26
        }
27
28
        return strpos($image->getAttribute('src'), $avatarPath) !== false;
29
    }
30
}
31