Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore

# Explicit text file types
*.php text
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/PHPUnit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PHPUnit

on:
pull_request:

permissions: read-all

jobs:
build:
uses: The-FireHub-Project/.github/.github/workflows/RunCommandOnMatrix.yml@master
with:
title: "Run PHPUnit"
phpVersions: ${{ vars.PHP_VERSIONS }}
phpExtensions: ${{ vars.PHP_EXTENSIONS }}
tools: "phpunit:13.x"
command: "phpunit"
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
99 changes: 67 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
</h1>

<p>
<a href="https://github.com/The-FireHub-Project/Core-Standard/commits/develop/">
<a href="https://github.com/The-FireHub-Project/Core-Standard/commits/feature/phpunit-integration-and-initial-tests/">
<img
src="https://img.shields.io/github/last-commit/The-FireHub-Project/Core-Standard/develop?style=flat&logo=github&logoColor=959da5&label=last%20commit%20(branch)&labelColor=31373e"
src="https://img.shields.io/github/last-commit/The-FireHub-Project/Core-Standard/feature/phpunit-integration-and-initial-tests?style=flat&logo=github&logoColor=959da5&label=last%20commit%20(branch)&labelColor=31373e"
alt="GitHub last commit (branch)"
/></a>
<a href="https://github.com/The-FireHub-Project/Core-Standard/commits/develop/">
<a href="https://github.com/The-FireHub-Project/Core-Standard/commits/feature/phpunit-integration-and-initial-tests/">
<img
src="https://img.shields.io/github/commit-activity/m/The-FireHub-Project/Core-Standard/develop?style=flat&logo=github&logoColor=959da5&label=commit%20activity%20(branch)&labelColor=31373e"
src="https://img.shields.io/github/commit-activity/m/The-FireHub-Project/Core-Standard/feature/phpunit-integration-and-initial-tests?style=flat&logo=github&logoColor=959da5&label=commit%20activity%20(branch)&labelColor=31373e"
alt="GitHub activity (branch)"
/></a>
<a href="https://github.com/The-FireHub-Project/Core-Standard/compare/master...develop/">
<a href="https://github.com/The-FireHub-Project/Core-Standard/compare/develop...feature/phpunit-integration-and-initial-tests/">
<img
src="https://img.shields.io/github/commits-difference/The-FireHub-Project/Core-Standard?base=master&head=develop&style=flat&logo=github&logoColor=959da5&label=ahead%20master&labelColor=31373e"
src="https://img.shields.io/github/commits-difference/The-FireHub-Project/Core-Standard?base=develop&head=feature/phpunit-integration-and-initial-tests&style=flat&logo=github&logoColor=959da5&label=ahead%20develop&labelColor=31373e"
alt="GitHub commit difference between two branches"
/></a>
</p>
Expand All @@ -45,47 +45,82 @@ Standard provides the base classes, kernel, domain layer, and minimal runtime ut

---

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Development Branch
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> PHPUnit testing infrastructure – Development Branch

⚠️ **This is the `develop` branch**
⚠️ **This is the `development` branch**

- Unstable
- APIs may change without notice
- Not intended for production use

### Related

- Milestone: **Development v1**
- Target Release: **v0.0.0**
- Repository: FireHub Core Standard

### Pull request

<p>
<a href="https://github.com/The-FireHub-Project/Core-Standard/pull/6/">
<img
src="https://img.shields.io/github/pulls/detail/title/The-FireHub-Project/Core-Standard/6?style=flat&logo=github&logoColor=959da5&label=title&labelColor=31373e"
alt="GitHub pull request title"
/></a>
<a href="https://github.com/The-FireHub-Project/Core-Standard/pull/6/">
<img
src="https://img.shields.io/github/pulls/detail/author/The-FireHub-Project/Core-Standard/6?style=flat&logo=github&logoColor=959da5&labelColor=31373e"
alt="GitHub pull request author"
/></a>
<a href="https://github.com/The-FireHub-Project/Core-Standard/pull/6/">
<img
src="https://img.shields.io/github/pulls/detail/age/The-FireHub-Project/Core-Standard/6?style=flat&logo=github&logoColor=959da5&labelColor=31373e"
alt="GitHub pull request created"
/></a>
<a href="https://github.com/The-FireHub-Project/Core-Standard/pull/6/">
<img
src="https://img.shields.io/github/pulls/detail/comments/The-FireHub-Project/Core-Standard/6?style=flat&logo=github&logoColor=959da5&labelColor=31373e"
alt="GitHub pull request comments"
/></a>
</p>

### Milestone

<p>
<a href="https://github.com/The-FireHub-Project/Core-Standard/milestone/1/">
<img
src="https://img.shields.io/github/milestones/progress-percent/The-FireHub-Project/Core-Standard/1?style=flat&logo=github&logoColor=959da5&labelColor=31373e"
alt="GitHub milestone details"
/></a>
</p>

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Branch Purpose

The `develop` branch is the **primary integration branch** for all ongoing development.
This branch introduces the PHPUnit testing infrastructure and initial Core test coverage for the FireHub ecosystem.

It establishes the foundational testing layer required to validate Core behavior across:

It serves as the staging area where:
- Feature branches are merged
- Bug fixes are integrated
- Experimental work is stabilized
- Code is prepared for upcoming releases
- Core Standard
- Core Professional
- Core Enterprise
- Runtime Foundation (consumers only)

All **release branches** are created **from `develop`**.
This includes PHPUnit configuration, bootstrap alignment, and first executable test cases for Core contracts.

## Stability Guarantee
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Architectural Goal

❌ No backward compatibility guarantee
❌ APIs may change without notice
❌ Behavior may be incomplete or inconsistent
❌ Breaking changes are expected
Introduce a standardized testing layer for Core validation that:

This branch is intended **only for contributors and advanced testers**.
- Ensures Core contracts behave deterministically
- Provides automated verification of architectural rules
- Enables CI-level validation of Core stability
- Establishes testing as a first-class governance layer in FireHub

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Composer Usage (Not Recommended)
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Core Concept

For internal testing only:
A FireHub testing layer is:

```json
{
"require": {
"the-firehub-project/core-standard": "dev-develop"
}
}
```
⚠️ Never use dev-develop in production.
> A deterministic validation system that ensures Core contracts and architectural rules behave as specified, independent of runtime implementation details.

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Authors and Contributors

Expand All @@ -102,4 +137,4 @@ Architecture guidelines, design principles, and ecosystem documentation are avai

This software is licensed under the Apache-2.0 License.

For more details, read the full license [here](./LICENSE).
For more details, read the full license [here](./LICENSE).
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@
},
"require-dev": {
"phpstan/phpstan": "^2.0",
"the-firehub-project/phpstan-rules": "dev-develop"
"the-firehub-project/phpstan-rules": "dev-develop",

"the-firehub-project/testing": "dev-develop"
},
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"FireHub\\Core\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"FireHub\\Tests\\Core\\": "tests/"
}
},
"authors": [
{
"name": "Danijel Galić",
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
includes:
- vendor/the-firehub-project/phpstan-rules/src/config/base.neon
- vendor/the-firehub-project/phpstan-rules/src/Config/base.neon

parameters:
paths:
Expand Down
16 changes: 16 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
colors="true"
cacheDirectory=".build/phpunit/cache"
displayDetailsOnTestsThatTriggerWarnings="true">
<testsuites>
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
14 changes: 7 additions & 7 deletions src/type/firehub.ValueObject.php → src/Type/ValueObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ abstract public function value ():mixed;
*
* Compares this Value Object with another instance of the same type using strict
* class comparison and value equality semantics.
* @since 1.0.0
*
* @uses \FireHub\Core\Type\ValueObject::sameAs() To compare the VO types.
* @uses \FireHub\Core\Type\ValueObject::value() To compare the VO values.
*
* @param self<TValue> $other <p>
* The Value Object to compare against.
* </p>
*
* @return bool True if the VOs are equal, false otherwise.
*@uses \FireHub\Core\Type\ValueObject::value() To compare the VO values.
*
* @since 1.0.0
*
* @uses \FireHub\Core\Type\ValueObject::sameAs() To compare the VO types.
*/
final public function equals (self $other):bool {

Expand All @@ -66,13 +66,13 @@ final public function equals (self $other):bool {
* ### Checks strict identity equality of a Value Object type
*
* Ensures both objects are of the same concrete class without comparing values.
* @since 1.0.0
*
* @param \FireHub\Core\Type\ValueObject<TValue> $other <p>
* The Value Object to compare against.
* </p>
*
* @return bool True if the objects are of the same type, false otherwise.
*@since 1.0.0
*
*/
final public function sameAs (self $other):bool {

Expand Down
55 changes: 55 additions & 0 deletions tests/Stubs/Type/DummyIntVO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php declare(strict_types = 1);

/**
* This file is part of the FireHub Project ecosystem
*
* @author Danijel Galić <danijel.galic@outlook.com>
* @copyright 2026-present The FireHub Project - All rights reserved
* @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0
*
* @php-version >=8.2
* @package Core\Tests
*/

namespace FireHub\Tests\Core\Stubs\Type;

use FireHub\Core\Type\ValueObject;
use InvalidArgumentException;

/**
* ### Dummy int Value Object
* @since 1.0.0
*/
readonly class DummyIntVO extends ValueObject {

/**
* ### Constructor
* @since 1.0.0
*
* @param int $value
*
* @return void
*/
public function __construct (
private int $value = 1
) {

$this->guard(
fn() => $this->value > 0,
fn() => new InvalidArgumentException('Value must be positive.')
);

}

/**
* @inheritDoc
*
* @since 1.0.0
*/
public function value ():int {

return $this->value;

}

}
55 changes: 55 additions & 0 deletions tests/Stubs/Type/DummyStringVO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php declare(strict_types = 1);

/**
* This file is part of the FireHub Project ecosystem
*
* @author Danijel Galić <danijel.galic@outlook.com>
* @copyright 2026-present The FireHub Project - All rights reserved
* @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0
*
* @php-version >=8.2
* @package Core\Tests
*/

namespace FireHub\Tests\Core\Stubs\Type;

use FireHub\Core\Type\ValueObject;
use InvalidArgumentException;

/**
* ### Dummy string Value Object
* @since 1.0.0
*/
readonly class DummyStringVO extends ValueObject {

/**
* ### Constructor
* @since 1.0.0
*
* @param string $value
*
* @return void
*/
public function __construct (
private string $value = 'default'
) {

$this->guard(
fn() => $this->value !== '',
fn() => new InvalidArgumentException('Value cannot be empty.')
);

}

/**
* @inheritDoc
*
* @since 1.0.0
*/
public function value ():string {

return $this->value;

}

}
Loading
Loading