Server IP : 127.0.0.2 / Your IP : 18.191.44.139 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Core/ |
Upload File : |
<?php namespace Hamcrest\Core; class SetTest extends \Hamcrest\AbstractMatcherTest { public static $_classProperty; public $_instanceProperty; protected function setUp() { self::$_classProperty = null; unset($this->_instanceProperty); } protected function createMatcher() { return \Hamcrest\Core\Set::set('property_name'); } public function testEvaluatesToTrueIfArrayPropertyIsSet() { assertThat(array('foo' => 'bar'), set('foo')); } public function testNegatedEvaluatesToFalseIfArrayPropertyIsSet() { assertThat(array('foo' => 'bar'), not(notSet('foo'))); } public function testEvaluatesToTrueIfClassPropertyIsSet() { self::$_classProperty = 'bar'; assertThat('Hamcrest\Core\SetTest', set('_classProperty')); } public function testNegatedEvaluatesToFalseIfClassPropertyIsSet() { self::$_classProperty = 'bar'; assertThat('Hamcrest\Core\SetTest', not(notSet('_classProperty'))); } public function testEvaluatesToTrueIfObjectPropertyIsSet() { $this->_instanceProperty = 'bar'; assertThat($this, set('_instanceProperty')); } public function testNegatedEvaluatesToFalseIfObjectPropertyIsSet() { $this->_instanceProperty = 'bar'; assertThat($this, not(notSet('_instanceProperty'))); } public function testEvaluatesToFalseIfArrayPropertyIsNotSet() { assertThat(array('foo' => 'bar'), not(set('baz'))); } public function testNegatedEvaluatesToTrueIfArrayPropertyIsNotSet() { assertThat(array('foo' => 'bar'), notSet('baz')); } public function testEvaluatesToFalseIfClassPropertyIsNotSet() { assertThat('Hamcrest\Core\SetTest', not(set('_classProperty'))); } public function testNegatedEvaluatesToTrueIfClassPropertyIsNotSet() { assertThat('Hamcrest\Core\SetTest', notSet('_classProperty')); } public function testEvaluatesToFalseIfObjectPropertyIsNotSet() { assertThat($this, not(set('_instanceProperty'))); } public function testNegatedEvaluatesToTrueIfObjectPropertyIsNotSet() { assertThat($this, notSet('_instanceProperty')); } public function testHasAReadableDescription() { $this->assertDescription('set property foo', set('foo')); $this->assertDescription('unset property bar', notSet('bar')); } public function testDecribesPropertySettingInMismatchMessage() { $this->assertMismatchDescription( 'was not set', set('bar'), array('foo' => 'bar') ); $this->assertMismatchDescription( 'was "bar"', notSet('foo'), array('foo' => 'bar') ); self::$_classProperty = 'bar'; $this->assertMismatchDescription( 'was "bar"', notSet('_classProperty'), 'Hamcrest\Core\SetTest' ); $this->_instanceProperty = 'bar'; $this->assertMismatchDescription( 'was "bar"', notSet('_instanceProperty'), $this ); } }