1
0
mirror of https://github.com/php/phd.git synced 2026-03-24 07:02:07 +01:00

13 Commits

Author SHA1 Message Date
haszi
b80ae36dba Change property names to camel case 2024-12-29 19:58:10 +00:00
haszi
e66f34e029 Fix tests 2024-12-29 19:58:10 +00:00
haszi
15284136ff Separate regular PhD output from error handling (#176)
- Move error handling code into a class and remove PhD message output handling from it.
- Introduce a new class to handle PhD message output.
- Make the implicit dependency on the output functionality of classes explicit.
- Update PEAR package.xml.
- Fix tests.
- Use proper variadic parameters
- Use class constants
- Use first-class callable syntax

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-11-10 17:57:05 +00:00
haszi
543bb5bf25 Move constant definitions to a dedicated file 2024-10-21 14:36:48 +01:00
haszi
8ca0905687 Remove Config from Autoloader (#143)
Remove Config from Autoloader by replacing it with a static array and a setter method.
Update render.php and setup.php to pass package directories to Autoloader.
Add test.

Co-authored-by: haszi <haszika80@gmail.com>
2024-07-09 19:52:23 +01:00
haszi
d6dba1a2b8 Convert Config in tests
Instantiate a Config object in setup.php.
Use instantiated object in all tests with non-static methods.
2024-06-21 02:50:44 +01:00
haszi
e6e6847d7b Refactor Options Parser and default Options Handler (#110)
* Refactor Options Parser and default Options Handler

Refactor default Options Handler to accept dependencies through its constructor.
Refactor default Options Handler to return an array of options instead of directly setting options in Config and declare array return types.
Refactor method in Options Parser to return an array of options and declare its return type as array.
Inject all necessary dependencies in render.php.
Refactor two methods in default Options Handler by using match expressions.

* Minor refactor of files used in tests

Inlcude Config with require_once instead of require in Autloader.
Define __INSTALLDIR__ only if it is not defined yet in render.php.
Include Autoloader and functions.php with require_once instead of require.
Remove unnecessary __PHPDIR__ constant, correct path for __INSTALLDIR__ and use that constant in setup.php.

* Remove var_dump from Options Parser

* Fix inconsistent option flags in default Option Handler

* Add default Options Handler tests

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-03-17 18:29:43 +00:00
haszi
b703f50bdf Refactor test helpers and test files (#104)
* Add Format as an optional constructor dependency to TestRender

Add Format as an optional constructor dependency to TestRender.
Check format's methods conditionally.
Refactor tests to inject formats.

* Add Config as a constructor dependency to TestRender

Add Config as a constructor dependency to TestRender.
Refactor tests to inject Config.

* Add Index as an optional constructor dependency to TestRender

* TestRender to extend Render

* Config to allow calling instance methods

* Refactor test helpers and test directory structure

Refactor TestRender to use only constructor injected objects.
Rename test format helper classes to indicate which package they belong to.
Move TestRender and all format helper classes into the phpdotnet phd directory to enable autoloading.
Remove all unnecessary lines from setup.php.
Restructure test directory to follow the structure of the tested classes.

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-26 15:12:03 +00:00
haszi
e5b8bf35a9 Remove file ending comment blocks (#92)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-08 12:46:21 +00:00
haszi
e4a363fde2 Fix tests (#91)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-07 18:48:35 +00:00
Peter Kokot
0ca596e64e Trim trailing whitespace 2018-10-02 06:13:46 +02:00
Sobak
aecae4e2c3 Eliminate $ comments 2015-03-09 06:20:39 +01:00
Moacir de Oliveira Miranda Júnior
fcb1321668 test classes 2009-08-10 16:29:41 +00:00