Completed
Push — master ( e7a5da...92b80b )
by Rudie
02:05
created

SimpleFeatureContext::theDatabaseShouldContain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
use Behat\Behat\Context\Context;
4
use Behat\Behat\Context\SnippetAcceptingContext;
5
use Behat\Behat\Tester\Exception\PendingException;
6
use Behat\Gherkin\Node\PyStringNode;
7
8
class SimpleFeatureContext implements Context, SnippetAcceptingContext {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
9
10
	/**
11
	 * @Given a value :value
12
	 */
13
	public function aValue($value) {
14
		return $value;
15
	}
16
17
	/**
18
	 * @Given values :value1 and :value2
19
	 */
20
	public function valuesAnd($value1, $value2) {
21
		return [$value1, $value2];
22
	}
23
24
	/**
25
	 * @Then :a should equal :b
26
	 */
27
	public function shouldEqual($a, $b) {
28
		if ($a != $b) {
29
			throw new \Exception("a ($a) does not equal b ($b)");
30
		}
31
	}
32
33
	/**
34
	 * @Then the database should contain:
35
	 */
36
	public function theDatabaseShouldContain(PyStringNode $string) {
0 ignored issues
show
Unused Code introduced by
The parameter $string is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
		throw new \Exception("My context has no way to access the database...");
38
	}
39
40
}
41