{"id":25010498,"url":"https://github.com/shayanabbas/simple-php-unit-test","last_synced_at":"2025-03-30T02:31:08.568Z","repository":{"id":199925455,"uuid":"127767101","full_name":"shayanabbas/Simple-PHP-Unit-Test","owner":"shayanabbas","description":"Simple-PHP-Unit-Test library generate a simple unit test report after testing your methods with different types of variables and inputs.","archived":false,"fork":false,"pushed_at":"2018-04-02T15:17:02.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T04:53:32.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shayanabbas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-04-02T14:26:05.000Z","updated_at":"2018-04-02T15:17:04.000Z","dependencies_parsed_at":"2023-10-13T17:15:02.347Z","dependency_job_id":"3a64094c-5a6d-48f2-9b0e-185a01477a39","html_url":"https://github.com/shayanabbas/Simple-PHP-Unit-Test","commit_stats":null,"previous_names":["shayanabbas/simple-php-unit-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shayanabbas%2FSimple-PHP-Unit-Test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shayanabbas%2FSimple-PHP-Unit-Test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shayanabbas%2FSimple-PHP-Unit-Test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shayanabbas%2FSimple-PHP-Unit-Test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shayanabbas","download_url":"https://codeload.github.com/shayanabbas/Simple-PHP-Unit-Test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246268913,"owners_count":20750183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-05T04:53:36.115Z","updated_at":"2025-03-30T02:31:08.548Z","avatar_url":"https://github.com/shayanabbas.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple-PHP-Unit-Test\nSimple-PHP-Unit-Test library generate a simple unit test report after testing your methods with different types of variables and inputs.\n\n## Requirement\nPHP v7\n\n## How to use?\nInclude and initialize the library on your file.\n```php\ninclude_once('classes/Test.class.php');\n$test = new Test();\n```\n\nInclude and initialize your class to test it's method.\nAs for a reference I have added a small Data class in [classes/Data.class.php](https://github.com/shayanabbas/Simple-PHP-Unit-Test/blob/master/classes/Data.class.php)\nSo we are going to use it for reference, you can also check/run [tests.php](https://github.com/shayanabbas/Simple-PHP-Unit-Test/blob/master/tests.php) file\n\n```php\ninclude_once('classes/Data.class.php');\n$data = new Data();\n```\n\nNow were going to test $data-\u003evalidateFileEncoding() method\nCheck the following for parameter details\n```php\n* @param class $class class of which method to be tested\n* @param string $method name of method of the class\n* @param string $expectedOutput output that is expected \n* @param int $numberOfParams number of params in method. Default: 1\n* @param array $additionalData additional data to test. (optional)\n```\nNow we will test our method.\n```php\n$test-\u003eresult( $data, 'validateFileEncoding', 'boolean', '1' );\n```\nOnce Run it will show results like following and also check [unit_test_results.html](https://github.com/shayanabbas/Simple-PHP-Unit-Test/blob/master/unit_test_results.html)\n```html\nTesting Data-\u003evalidateFileEncoding()\n\nExpected Output: boolean\n\n\nInput Type: string\nInput Data: This is a string data.\nResult: boolean\nPASS\n\nInput Type: int\nInput Data: 1\nResult: boolean\nPASS\n\nInput Type: int\nInput Data: 0\nResult: boolean\nPASS\n\nInput Type: float\nInput Data: 2\nResult: boolean\nPASS\n\nInput Type: array\nInput Data: array(0) {\n}\n\nResult: boolean\nPASS\n\nInput Type: boolean\nInput Data: 1\nResult: boolean\nPASS\n\nInput Type: boolean\nInput Data: \nResult: boolean\nPASS\n```\n\n## Credits\n[@shayanabbas](https://github.com/shayanabbas/)\n### Buy me a coffee\n```\nBTC 36HyrBuZU4ZfaP7fo58abm7ryp2qtmRoC2\nETH 0xb30d4977DC307617cFD1F4d55cE969316d7b44E2\nXRP rN3871uxDiGt3hfaPXe2x31EbKAzHY5Bqj\nETC 0x0B600A27ebD06A3820acfEC2E277E61b9297850b\nLTC MUAy1xBxKYap4y8id58L4g8U89R6jGizNN\nBCH 1PogvRYk9vNwghSGzhuANRFYM2ppqLPqG7\nNEO AUQ1vfwpycjXTf5gq3F4fKinRL6xfhB1em\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshayanabbas%2Fsimple-php-unit-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshayanabbas%2Fsimple-php-unit-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshayanabbas%2Fsimple-php-unit-test/lists"}