Completed
Push — master ( ce58c6...c67fb3 )
by Henry
09:17
created

ResetTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 52
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testTitle() 0 11 1
A testRecover() 0 13 1
1
<?php
2
namespace Redaxscript\Tests;
3
4
use Facebook\WebDriver\WebDriverBy;
5
6
/**
7
 * ResetTest
8
 *
9
 * @since 4.2.0
10
 *
11
 * @package Redaxscript
12
 * @category Tests
13
 * @author Henry Ruhs
14
 */
15
16
class ResetTest extends TestCaseAbstract
17
{
18
	/**
19
	 * setUp
20
	 *
21
	 * @since 4.2.0
22
	 */
23
24
	public function setUp() : void
25
	{
26
		parent::setUp();
27
		$this->_driver->get('http://localhost:8000/?p=login/reset/abc/1');
28
	}
29
30
	/**
31
	 * testTitle
32
	 *
33
	 * @since 4.2.0
34
	 */
35
36
	public function testTitle() : void
37
	{
38
		/* expect and actual */
39
40
		$expect = $this->_language->get('reset') . ' - ' . $this->_language->get('_package')['name'];
41
		$actual = $this->_driver->getTitle();
42
43
		/* compare */
44
45
		$this->assertEquals($expect, $actual);
46
	}
47
48
	/**
49
	 * testReset
50
	 *
51
	 * @since 4.2.0
52
	 */
53
54
	public function testRecover() : void
55
	{
56
		/* setup */
57
58
		$formElement = $this->_driver->findElement(WebDriverBy::tagName('form'));
59
		$taskElement = $formElement->findElement(WebDriverBy::id('task'));
60
		$buttonElement = $formElement->findElement(WebDriverBy::tagName('button'));
61
62
		/* compare */
63
64
		$this->assertTrue($taskElement->isDisplayed());
65
		$this->assertTrue($buttonElement->isDisplayed());
66
	}
67
}
68