<?php require '../vendor/autoload.php';

use Intellex\Curly\Method;
use Intellex\Curly\Exception\MethodNotSupportedException;

$cases = [
	[ 'get', Method::GET ],
	[ 'poST', Method::POST ],
	[ 'patch ', Method::PATCH ],
	[ ' HEAD', Method::HEAD ],
	[ 'OPTIONs', Method::OPTIONS ],
	[ 'Put', Method::PUT ],
	[ 'DELETE', Method::DELETE ],
	[ 'CoNnEcT', Method::CONNECT ],
	[ 'del', new MethodNotSupportedException('del') ],
	[ 'OPTION', new MethodNotSupportedException('OPTION') ],
	[ 'exception', new MethodNotSupportedException('exception') ]
];

test($cases, function($input) { return \Intellex\Curly\Method::validate($input); });
