/** * Asserts that a haystack contains only values of a given type. * * @param string $type * @param mixed $haystack * @param boolean $isNativeType * @param string $message * @since Method available since Release 3.1.4 */ function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '') { return PHPUnit_Framework_Assert::assertContainsOnly($type, $haystack, $isNativeType, $message); }
public function toContainType($type) { if ($this->negate) { a::assertNotContainsOnly($type, $this->actual); } else { a::assertContainsOnly($type, $this->actual); } }
public function containsOnly($type, $isNativeType = NULL) { a::assertContainsOnly($type, $this->actual, $isNativeType, $this->description); }
/** * Expect that a haystack contains only values of a given type. * * @param string $type * @param bool $isNativeType * @param string $message * * @return Expect */ public function toContainOnly($type, $isNativeType = null, $message = '') { Assert::assertContainsOnly($type, $this->value, $isNativeType, $message); return $this; }
/** * @Then the api/API result should contain at least :count item(s) * @Then the api/API result contains at least :count item(s) */ public function theResultContainsAtLeastItems($count) { $result = $this->getApiResult(); Assert::assertContainsOnly('array', $result); Assert::assertGreaterThanOrEqual($count, count($result)); }
/** * Tests that key & value arrays are converted to indexed * arrays during map instantiation * * @covers \ERP\ComplexMap::__constructor */ public function testInternalArrayConversion() { $reflectionClass = new \ReflectionClass(new ComplexMap(['foo' => 'bar'], ['bax' => 12345])); $keysProperty = $reflectionClass->getProperty('keys'); $valuesProperty = $reflectionClass->getProperty('values'); $keysProperty->setAccessible(true); $valuesProperty->setAccessible(true); \PHPUnit_Framework_Assert::assertContainsOnly('integer', array_keys($keysProperty->getValue($this->complexMap))); \PHPUnit_Framework_Assert::assertContainsOnly('integer', array_keys($valuesProperty->getValue($this->complexMap))); }