Skip to content

Commit

Permalink
Verify 2.1.0
Browse files Browse the repository at this point in the history
* Added new expect-toBe and expect-notTo BDD Syntax.
* Added full documentation about Expectations.
* Fixed minor bugs.
* Deleted RoboFile and VERSION file.
* BC: `expect` function now works with expectations instead of verifiers.
  • Loading branch information
Gustavo Nieves committed Sep 3, 2020
2 parents 66b075b + 2b2972a commit 11fa56c
Show file tree
Hide file tree
Showing 31 changed files with 2,667 additions and 144 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog

## 2.1

* Added new expect-toBe and expect-notTo BDD Syntax.
* Added full documentation about Expectations.
* Fixed minor bugs.
* Deleted RoboFile and VERSION file.
* **BC:** `expect` function now works with expectations instead of verifiers.

## 2.0

* Support for Chained Verifiers.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2015 Codeception PHP Testing Framework
Copyright (c) 2013-2020 Codeception PHP Testing Framework

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
23 changes: 16 additions & 7 deletions README.md
Expand Up @@ -21,7 +21,7 @@ With [BDD][3] assertions influenced by [Chai][4], [Jasmine][5], and [RSpec][6] y
composer require codeception/verify --dev
```

> :arrow_up: **Upgrade from 1.x by following [the upgrade guide.][9]**
> :arrow_up: **Upgrade from 1.x by following [the upgrade guide.][10]**

## Usage
Expand Down Expand Up @@ -83,11 +83,19 @@ Verify::Callable($callback)
## Alternative Syntax

If you follow TDD/BDD you'd rather use `expect` or `verify_that` instead of `verify`. Which are just an alias function:
If you follow TDD/BDD you'd rather use `expect` instead of `verify`:

```php
expect($user->getNumPosts())->equals(5, 'user have 5 posts');
expect($user->getNumPosts())
->notToBeNull()
->toBeInt()
->toEqual(5, 'user have 5 posts');
```
> :page_facing_up: **See Expectations full list [here.][8]**
>
Or `verify_that` which is just an alias function:

```php
verify_that($user->getRate())->equals(7, 'first user rate is 7');
```

Expand Down Expand Up @@ -117,7 +125,7 @@ class MyVerify extends Verify {
```

And use it!

```php
$myVerify = new MyVerify;

Expand All @@ -128,7 +136,7 @@ $myVerify::Mixed('this also')->notEquals('works');

## License

Verify is open-sourced software licensed under the [MIT][8] License.
Verify is open-sourced software licensed under the [MIT][9] License.
© Codeception PHP Testing Framework

[1]: https://phpunit.de/
Expand All @@ -138,5 +146,6 @@ Verify is open-sourced software licensed under the [MIT][8] License.
[5]: http://jasmine.github.io/
[6]: http://rspec.info/
[7]: /docs/supported_verifiers.md
[8]: /LICENSE
[9]: /UPGRADE.md
[8]: /docs/supported_expectations.md
[9]: /LICENSE
[10]: /UPGRADE.md
32 changes: 0 additions & 32 deletions RoboFile.php

This file was deleted.

1 change: 0 additions & 1 deletion VERSION

This file was deleted.

182 changes: 182 additions & 0 deletions docs/supported_expectations.md
@@ -0,0 +1,182 @@
## Expectations List

`expect()` supports all the expectations listed here! :rocket:

### Array
```
notToContain
notToContainEqual
notToContainOnly
notToHaveCount
notToHaveKey
notToHaveSameSizeAs
toContain
toContainEqual
toContainOnly
toContainOnlyInstancesOf
toHaveCount
toHaveKey
toHaveSameSizeAs
```

### BaseObject
```
notToHaveAttribute
toHaveAttribute
```

### Callable
```
notToThrow
toThrow
```

### Class
```
notToHaveAttribute
notToHaveStaticAttribute
toHaveAttribute
toHaveStaticAttribute
```

### Directory
```
notToBeReadable
notToBeWritable
notToExist
toBeReadable
toBeWritable
toExist
toExistAndNotToBeReadable
toExistAndNotToBeWritable
toExistAndToBeReadable
toExistAndToBeWritable
```

### File
```
notToBeReadable
notToBeWritable
notToExist
toBeEqual
toBeEqualCanonicalizing
toBeEqualIgnoringCase
toBeReadable
toBeWritable
toExist
toExistAndNotToBeReadable
toExistAndNotToBeWritable
toExistAndToBeReadable
toExistAndToBeWritable
toNotEqual
toNotEqualCanonicalizing
toNotEqualIgnoringCase
```

### JsonFile
```
notToEqualJsonFile
toEqualJsonFile
```

### JsonString
```
notToEqualJsonFile
notToEqualJsonString
toEqualJsonFile
toEqualJsonString
```

### Mixed
```
notToBe
notToBeArray
notToBeBool
notToBeCallable
notToBeClosedResource
notToBeEmpty
notToBeFalse
notToBeFloat
notToBeInstanceOf
notToBeInt
notToBeIterable
notToBeNull
notToBeNumeric
notToBeObject
notToBeResource
notToBeScalar
notToBeString
notToBeTrue
notToEqual
notToEqualCanonicalizing
notToEqualIgnoringCase
notToEqualWithDelta
toBe
toBeArray
toBeBool
toBeCallable
toBeClosedResource
toBeEmpty
toBeFalse
toBeFinite
toBeFloat
toBeGreaterThan
toBeGreaterThanOrEqualTo
toBeInfinite
toBeInstanceOf
toBeInt
toBeIterable
toBeLessThan
toBeLessThanOrEqualTo
toBeNan
toBeNull
toBeNumeric
toBeObject
toBeResource
toBeScalar
toBeString
toBeTrue
toEqual
toEqualCanonicalizing
toEqualIgnoringCase
toEqualWithDelta
```

### String
```
notToContainString
notToContainStringIgnoringCase
notToEndWith
notToEqualFile
notToEqualFileCanonicalizing
notToEqualFileIgnoringCase
notToMatchFormat
notToMatchFormatFile
notToMatchRegExp
notToStartWith
toBeJson
toContainString
toContainStringIgnoringCase
toEndWith
toEqualFile
toEqualFileCanonicalizing
toEqualFileIgnoringCase
toMatchFormat
toMatchFormatFile
toMatchRegExp
toStartWith
```

### XmlFile
```
notToEqualXmlFile
toEqualXmlFile
```

### XmlString
```
notToEqualXmlFile
notToEqualXmlString
toEqualXmlFile
toEqualXmlString
```
9 changes: 8 additions & 1 deletion docs/supported_verifiers.md
Expand Up @@ -43,6 +43,10 @@ notHasStaticAttribute
```
doesNotExist
exists
existsAndIsNotReadable
existsAndIsNotWritable
existsAndIsReadable
existsAndIsWritable
isNotReadable
isNotWritable
isReadable
Expand All @@ -56,6 +60,10 @@ equals
equalsCanonicalizing
equalsIgnoringCase
exists
existsAndIsNotReadable
existsAndIsNotWritable
existsAndIsReadable
existsAndIsWritable
isNotReadable
isNotWritable
isReadable
Expand Down Expand Up @@ -131,7 +139,6 @@ notSame
notTrue
null
same
that
true
```

Expand Down

0 comments on commit 11fa56c

Please sign in to comment.