Test::Mockify::Matcher - To define parameter matchers
Use Test::Mockify::Matcher to define different types of expected parameters. See method description for more details.
SupportedTypes();
The SupportedTypes will return all supported matcher types as an array ref.
SupportedTypes
String(); String('abc');
The String method will create the matcher in the needed structure to match a string. If called with parameter, it will be proved that this value is actually a string. If not, it will create an error.
String
Number(); Number(123);
The Number method will create the matcher in the needed structure to match a number. If called with parameter, it will be proved that this value is actually a number. If not, it will create an error.
Number
HashRef(); HashRef({1 => 23});
The HashRef method will create the matcher in the needed structure to match a hash reference. If called with parameter, it will be proved that this value is actually a hash reference. If not, it will create an error.
HashRef
ArrayRef(); ArrayRef([1,23]);
The ArrayRef method will create the matcher in the needed structure to match an array reference. If called with parameter, it will be proved that this value is actually an array reference. If not, it will create an error.
ArrayRef
Object(); Object('Path::To::Object');
The Object method will create the matcher in the needed structure to match an object. If called with parameter, it will be proved that this value is actually an string of the object path. If not, it will create an error.
Object
Function();
The Function method will create the matcher in the needed structure to match a function pointer.
Function
Undef();
The Undef method will create the matcher in the needed structure to match an undefined value.
Undef
Any();
The Any method will create the matcher in the needed structure to match any type of parameter.
Any
Copyright (C) 2017 ePages GmbH
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Christian Breitkreutz <cbreitkreutz@epages.com>
To install Test::Mockify, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Mockify
CPAN shell
perl -MCPAN -e shell install Test::Mockify
For more information on module installation, please visit the detailed CPAN module installation guide.