PHP code example of jameshalsall / phpspec-array-contains-matchers

1. Go to this page and download the library: Download jameshalsall/phpspec-array-contains-matchers library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jameshalsall / phpspec-array-contains-matchers example snippets


$this->getArray()->shouldContainOnly(1, 2, 3);

$this->getArray()->shouldContainAnyOf(3, 4, 5);

$this->getArray()->shouldNotContainAnyOf(3, 7);

$this->getArray()->shouldContainAllOf(2, 3);

$this->getArray()->shouldContainAllOf(2, 3, 4);

$this->getArray()->shouldNotContainAllOf(2, 3)

$this->getArray()->shouldNotContainOnly(1, 2, 3);

$this->getArray()->shouldContainAnyOf(5, 6);