Test::Mockify::Matcher - To define parameter matchers
Use Test::Mockify::Matcher to define different types of expected parameters. See method description for more details.
The SupportedTypes will return all supported matcher types as an array ref.
SupportedTypes
SupportedTypes();
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
String(); String('abc');
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
Number(); Number(123); Number(45.67);
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
HashRef(); HashRef({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
ArrayRef(); ArrayRef([1,23]);
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
Object(); Object('Path::To::Object');
The Function method will create the matcher in the needed structure to match a function pointer.
Function
Function();
The Undef method will create the matcher in the needed structure to match an undefined value.
Undef
Undef();
The Any method will create the matcher in the needed structure to match any type of parameter.
Any
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 <christianbreitkreutz@gmx.de>
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.