[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/tests/includes/ -> utils.php (summary)

Helper functions & classes for the YOURLS Unit Tests suite

File Size: 142 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

Change_One_Global:: (1 method):
  change_it()

Change_Variable:: (3 methods):
  change_it()
  yourls_ut_print()
  yourls_ut_var_dump()

Log_in_File:: (2 methods):
  log()
  start_log()

Defines 2 functions

  rand_str()
  yut_is_local()
  change_one_global()
  change_variable()

Class: Change_One_Global  - X-Ref

Dummy class & function to be called by hook function tests

change_it()   X-Ref
No description

Class: Change_Variable  - X-Ref

Dummy class & function to be called by hook function tests

change_it( $var )   X-Ref
No description

yourls_ut_print( ...$what )   X-Ref
print() for Unit Tests


yourls_ut_var_dump( ...$what )   X-Ref
var_dump() for Unit Tests

since: 0.1

Class: Log_in_File  - X-Ref

Log in a local text file, in case you need to var_dump() stuff within a test

By design, you cannot var_dump() stuff during a unit test. A workaround is to export into a log file.
Usage : anywhere you would have used a regular var_dump() you can simply add:
Log_in_File::log( $something );

log( $what )   X-Ref
No description

start_log()   X-Ref
No description

Functions
Functions that are not part of a class:

rand_str( $len=32 )   X-Ref
Return a random string (for option name, etc...)

since: 0.1
return: string Random string
param: string $len Optional string length

yut_is_local()   X-Ref
Check if we are running locally (someone typed 'phpunit' in a shell) or in Travis. Return true if local.

since: 0.1

change_one_global()   X-Ref
Dummy function to be called by hook function tests

since: 0.1

change_variable( $var )   X-Ref
Dummy function to be called by hook function tests

since: 0.1



Generated: Wed Sep 28 05:10:02 2022 Cross-referenced by PHPXref 0.7.1