Skip to content

Commit 9f08236

Browse files
committed
Merge branch 'master' of github.com:Codeception/Verify
2 parents 508d484 + 29907fd commit 9f08236

4 files changed

Lines changed: 50 additions & 88 deletions

File tree

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@ language: php
33
php:
44
- 5.3
55
- 5.4
6-
- 5.5
6+
- 5.5
7+
- 5.6
8+
9+
sudo: false
10+
11+
before_install:
12+
- composer self-update
13+
- composer install --prefer-source
14+
15+
script: vendor/bin/phpunit

composer.lock

Lines changed: 30 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Codeception/Verify.php

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Codeception;
33

4-
use \PHPUnit_Framework_Assert as a;
4+
use PHPUnit_Framework_Assert as a;
55

66
class Verify {
77

@@ -140,7 +140,7 @@ public function notInternalType($type)
140140

141141
public function hasAttribute($attribute)
142142
{
143-
if ( is_string($attribute)) {
143+
if (is_string($attribute)) {
144144
a::assertClassHasAttribute($attribute, $this->actual, $this->description);
145145
} else {
146146
a::assertObjectHasAttribute($attribute, $this->actual, $this->description);
@@ -149,7 +149,7 @@ public function hasAttribute($attribute)
149149

150150
public function notHasAttribute($attribute)
151151
{
152-
if ( is_string($attribute)) {
152+
if (is_string($attribute)) {
153153
a::assertClassNotHasAttribute($attribute, $this->actual, $this->description);
154154
} else {
155155
a::assertObjectNotHasAttribute($attribute, $this->actual, $this->description);
@@ -198,23 +198,23 @@ public function equalXMLStructure($xml, $checkAttributes = FALSE)
198198

199199
public function exists()
200200
{
201-
if ( ! $this->isFileExpectation ) {
201+
if (!$this->isFileExpectation ) {
202202
throw new \Exception('exists() expectation should be called with expect_file()');
203203
}
204204
a::assertFileExists($this->actual, $this->description);
205205
}
206206

207207
public function notExists()
208208
{
209-
if ( ! $this->isFileExpectation ) {
209+
if (!$this->isFileExpectation ) {
210210
throw new \Exception('notExists() expectation should be called with expect_file()');
211211
}
212212
a::assertFileNotExists($this->actual, $this->description);
213213
}
214214

215215
public function equalsJsonFile($file)
216216
{
217-
if ( ! $this->isFileExpectation ) {
217+
if (!$this->isFileExpectation ) {
218218
a::assertJsonStringEqualsJsonFile($file, $this->actual, $this->description);
219219
} else {
220220
a::assertJsonFileEqualsJsonFile($file, $this->actual, $this->description);
@@ -261,21 +261,6 @@ public function notSame($expected)
261261
a::assertNotSame($expected, $this->actual, $this->description);
262262
}
263263

264-
public function selectCount($selector, $count)
265-
{
266-
a::assertSelectCount($selector, $count, $this->actual, $this->description);
267-
}
268-
269-
public function selectEquals($selector, $content, $count)
270-
{
271-
a::assertSelectEquals($selector, $content, $count, $this->actual, $this->description);
272-
}
273-
274-
public function selectRegExp($selector, $pattern, $count)
275-
{
276-
a::assertSelectRegExp($selector, $pattern, $count, $this->actual, $this->description);
277-
}
278-
279264
public function endsWith($suffix)
280265
{
281266
a::assertStringEndsWith($suffix, $this->actual, $this->description);
@@ -306,14 +291,9 @@ public function notStartsWith($prefix)
306291
a::assertStringStartsNotWith($prefix, $this->actual, $this->description);
307292
}
308293

309-
public function tag($matcher)
310-
{
311-
a::assertTag($matcher, $this->actual, $this->description);
312-
}
313-
314294
public function equalsXmlFile($file)
315295
{
316-
if ( ! $this->isFileExpectation ) {
296+
if (!$this->isFileExpectation ) {
317297
a::assertXmlStringEqualsXmlFile($file, $this->actual, $this->description);
318298
} else {
319299
a::assertXmlFileEqualsXmlFile($file, $this->actual, $this->description);
@@ -324,6 +304,4 @@ public function equalsXmlString($xmlString)
324304
{
325305
a::assertXmlStringEqualsXmlString($xmlString, $this->actual, $this->description);
326306
}
327-
328307
}
329-

tests/VerifyTest.php

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2+
23
include __DIR__.'/../src/Codeception/function.php';
4+
include __DIR__.'/../vendor/autoload.php';
35

46
class VerifyTest extends PHPUnit_Framework_TestCase {
57

@@ -173,24 +175,6 @@ public function testSame()
173175
expect(1)->notSame(true);
174176
}
175177

176-
public function testSelectCount()
177-
{
178-
expect($this->xml)->selectCount('foo bar', true);
179-
expect($this->xml)->selectCount('foo bar', 2);
180-
}
181-
182-
public function testSelectEquals()
183-
{
184-
expect($this->xml)->selectEquals('foo bar', 'Baz', true);
185-
expect($this->xml)->selectEquals('foo bar', 'Baz', 2);
186-
}
187-
188-
public function testSelectRegExp()
189-
{
190-
expect($this->xml)->selectRegExp('foo bar', '/Ba.*/', true);
191-
expect($this->xml)->selectRegExp('foo bar', '/Ba.*/', 2);
192-
}
193-
194178
public function testEndsWith()
195179
{
196180
expect('A completely not funny string')->endsWith('ny string');
@@ -209,15 +193,6 @@ public function testStartsWith()
209193
expect('A completely not funny string')->notStartsWith('string');
210194
}
211195

212-
public function testTag()
213-
{
214-
$matcher = array(
215-
'tag' => 'bar',
216-
'parent' => array('tag' => 'foo')
217-
);
218-
expect($this->xml)->tag($matcher);
219-
}
220-
221196
public function testEqualsXmlFile()
222197
{
223198
expect_file(__DIR__ . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'xml-test-file.xml')
@@ -231,12 +206,11 @@ public function testEqualsXmlString()
231206
expect('<foo><bar>Baz</bar><bar>Baz</bar></foo>')
232207
->equalsXmlString('<foo><bar>Baz</bar><bar>Baz</bar></foo>');
233208
}
234-
235209
}
236210

237211

238212

239213
class FakeClassForTesting
240214
{
241215
static $staticProperty;
242-
}
216+
}

0 commit comments

Comments
 (0)