{"id":15103754,"url":"https://github.com/haberkamp/phluent","last_synced_at":"2026-01-20T08:32:31.779Z","repository":{"id":251357159,"uuid":"837177010","full_name":"Haberkamp/phluent","owner":"Haberkamp","description":"A fluent assertion library for PHPUnit. Make your tests read the same way you speak.","archived":false,"fork":false,"pushed_at":"2024-08-19T14:21:11.000Z","size":195,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T09:13:30.282Z","etag":null,"topics":["assertions","fluent","php","phpunit","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Haberkamp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T11:29:38.000Z","updated_at":"2025-03-28T13:14:48.000Z","dependencies_parsed_at":"2024-08-19T16:38:02.430Z","dependency_job_id":null,"html_url":"https://github.com/Haberkamp/phluent","commit_stats":null,"previous_names":["haberkamp/phluent"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haberkamp%2Fphluent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haberkamp%2Fphluent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haberkamp%2Fphluent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haberkamp%2Fphluent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Haberkamp","download_url":"https://codeload.github.com/Haberkamp/phluent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248157233,"owners_count":21056977,"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":["assertions","fluent","php","phpunit","testing"],"created_at":"2024-09-25T19:41:54.072Z","updated_at":"2026-01-20T08:32:31.773Z","avatar_url":"https://github.com/Haberkamp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦 Phluent\n\nMake your tests read the same way you speak.\n\n## 🌟 Highlights\n\n- Write your tests in the same way you speak\n- Makes tests easier to understand\n- Improves collaboration and communication\n\n\n## ℹ️ Overview\n\nPhluent is an assertion library for PHPUnit. It's API design mimics how we speak as humans, this way it's easier\nfor you and your team members to understand what the test is doing.\n\nCompare the two assertions below, the first is using PHPUnit's Assert class and the other example uses Phluent.\n\n```php\nself::assertToBeGreaterThan(4, 3)\n```\n\n```php\nExpect(4)-\u003etoBeGreaterThan(3);\n```\n\nThe latter example is much easier to read and understand.\n\n\n### ✍️ Authors\n\nHello, I'm Nils Haberkamp. I strongly believe that writing better tests makes one a better developer, leads to better\ncommunication and collaboration and overall a better software. This package is my take on creating better tests.\n\n\n## 🚀 Usage\n\n```php\nuse PHPUnit\\Framework\\TestCase;\nuse function Phluent\\Expect;\n\nclass SomeTest extends TestCase {\n    public function test_one_plus_one_equals_two(): void\n    {\n        $result = 1 + 1;\n\n        Expect($result)-\u003etoBe(2);\n    }\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eAvailable assertions\u003c/summary\u003e\n\n* toBeEmpty\n* toBe\n* toBeAnInteger\n* toBeNegative\n* toBeInBetween\n* toBePositive\n* toBeGreaterThan\n* toBeLessThan\n* toBeAFloat\n* toBeLessThanOrEqual\n* toBeGreaterThanOrEqual\n* toBeAString\n* toBeEmpty\n* toStartWith\n* toEndWith\n* toBeABoolean\n* toBeAnArray\n* toBeInstanceOf\n* toBeNull\n* toBeFalse\n* toBeTrue\n* toContainAllOf\n* toContainAnyOf\n* toContain\n* toHaveALengthOf\n* toThrow\n  * withMessage\n* toHaveThrown\n  * withMessage\n\u003c/details\u003e\n\n\n## ⬇️ Installation\n\nFirst, install the package via composer:\n\n```bash\ncomposer require --dev phluent/phluent\n```\n\nNow you need to include phluent in your autoloader. To do this open\nthe file that bootstraps PHPUnit. (This file is often located under: `tests/bootstrap.php`)\nOpen the file and add the following code:\n\n```php\nrequire dirname(__DIR__) . '/vendor/phluent/phluent/src/Expect.php';\nrequire dirname(__DIR__) . '/vendor/phluent/phluent/src/Act.php';\n```\n\nThe installation is now complete, and you're all set.\n\nRequirements:\n\n* PHP 7.4 or higher\n* PHPUnit 9.0 or higher\n\n\n## 💭 Feedback and Contributing\n\nThank you for taking an interest in contributing to this project. Feel free to open an [issue](https://github.com/Haberkamp/phluent/issues/new)\nor a pull request if you have any suggestions or improvements.\n\n\n## 🏅 Thank you\n\nI want to thank the people who contributed to the following projects. Without them, this project would\nnot exist.\n\n* [Fluent Assertions](https://github.com/fluentassertions/fluentassertions)\n* [jest-extended](https://github.com/jest-community/jest-extended)\n* [expect-more-jest](https://github.com/JamieMason/expect-more/tree/master/packages/expect-more-jest)\n\nSpecial thanks to the maintainers and contributors of [PHPUnit](https://github.com/sebastianbergmann/phpunit)\nfor creating such an awesome project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaberkamp%2Fphluent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaberkamp%2Fphluent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaberkamp%2Fphluent/lists"}