PHPUnit_Framework_TestCase::assertInternalType PHP Method

assertInternalType() public method

public assertInternalType ( $type, $value )
    public function assertInternalType($type, $value)
    {
        switch (gettype($value)) {
            case 'integer':
                if ($type != 'int' && $type != 'integer') {
                    throw new Exception('Not expected type: ' . gettype($value));
                }
                return;
            default:
                if ($type != gettype($value)) {
                    throw new Exception('Not expected type: ' . gettype($value));
                }
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Stub delete method and add needed asserts
  *
  * @param  string $table
  * @param  array|string $where
  * @return int
  */
 public function delete($table, $where = '')
 {
     \PHPUnit_Framework_TestCase::assertEquals('catalog_product_option_type_title', $table);
     \PHPUnit_Framework_TestCase::assertInternalType('array', $where);
     \PHPUnit_Framework_TestCase::assertEquals(ValueTest::$valueTitleData['id'], $where['option_type_id = ?']);
     \PHPUnit_Framework_TestCase::assertEquals(ValueTest::$valueTitleData['store_id'], $where['store_id = ?']);
     return 0;
 }
All Usage Examples Of PHPUnit_Framework_TestCase::assertInternalType