Compare commits
1 Commits
b9c82d9923
...
aee8e47795
| Author | SHA1 | Date | |
|---|---|---|---|
| aee8e47795 |
@@ -1,4 +1,4 @@
|
|||||||
name: PHP Unit Tests
|
name: PHP Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
- name: Set up PHP
|
- name: Set up PHP
|
||||||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.5'
|
php-version: '8.5'
|
||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
@@ -21,4 +21,4 @@ jobs:
|
|||||||
run: composer install --prefer-dist --no-progress
|
run: composer install --prefer-dist --no-progress
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: composer test:unit
|
run: composer test
|
||||||
23
.github/workflows/js-unit-tests.yml
vendored
23
.github/workflows/js-unit-tests.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: JS Unit Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v6.2.0
|
|
||||||
with:
|
|
||||||
node-version: '24'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: npm run test:unit
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -15,8 +15,9 @@ node_modules/
|
|||||||
# Backend development
|
# Backend development
|
||||||
/vendor/
|
/vendor/
|
||||||
coverage/
|
coverage/
|
||||||
|
phpunit.xml.cache
|
||||||
.phpunit.cache
|
.phpunit.cache
|
||||||
.phpunit.coverage
|
.phpunit.result.cache
|
||||||
.php-cs-fixer.cache
|
.php-cs-fixer.cache
|
||||||
.phpstan.cache
|
.phpstan.cache
|
||||||
.phpactor/
|
.phpactor/
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"symfony/console": "^8.0"
|
"symfony/console": "^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^13.0"
|
"phpunit/phpunit": "^11.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
],
|
],
|
||||||
"post-update-cmd": [
|
"post-update-cmd": [
|
||||||
],
|
],
|
||||||
"test:unit": "phpunit --configuration tests/php/phpunit.unit.xml --colors=always --testdox",
|
"test": "phpunit --colors=always --testdox"
|
||||||
"test:coverage": "XDEBUG_MODE=coverage phpunit --configuration tests/php/phpunit.unit.xml --coverage-html .phpunit.coverage --coverage-text"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
803
composer.lock
generated
803
composer.lock
generated
File diff suppressed because it is too large
Load Diff
1630
package-lock.json
generated
1630
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -7,18 +7,14 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vite build --mode production",
|
"build": "vite build --mode production",
|
||||||
"build:modules": "for dir in modules/*/; do if [ -f \"$dir/package.json\" ]; then echo \"Building $dir\" && npm run build --prefix \"$dir\"; fi; done",
|
|
||||||
"build:all": "npm run build && npm run build:modules",
|
|
||||||
"dev": "vite build --mode development",
|
"dev": "vite build --mode development",
|
||||||
"dev:modules": "for dir in modules/*/; do if [ -f \"$dir/package.json\" ]; then echo \"Building $dir\" && npm run dev --prefix \"$dir\"; fi; done",
|
|
||||||
"dev:all": "npm run dev && npm run dev:modules",
|
|
||||||
"watch": "vite build --mode development --watch",
|
"watch": "vite build --mode development --watch",
|
||||||
"typecheck": "vue-tsc --noEmit",
|
"typecheck": "vue-tsc --noEmit",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||||
"test": "vitest run --config tests/js/vitest.config.ts",
|
"build:modules": "for dir in modules/*/; do if [ -f \"$dir/package.json\" ]; then echo \"Building $dir\" && npm run build --prefix \"$dir\"; fi; done",
|
||||||
"test:unit": "vitest run --config tests/js/vitest.config.ts",
|
"build:all": "npm run build && npm run build:modules",
|
||||||
"test:watch": "vitest watch --config tests/js/vitest.config.ts",
|
"dev:modules": "for dir in modules/*/; do if [ -f \"$dir/package.json\" ]; then echo \"Building $dir\" && npm run dev --prefix \"$dir\"; fi; done",
|
||||||
"test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts"
|
"dev:all": "npm run dev && npm run dev:modules"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/inter": "5.2.8",
|
"@fontsource/inter": "5.2.8",
|
||||||
@@ -43,14 +39,10 @@
|
|||||||
"@types/dompurify": "^3.2.0",
|
"@types/dompurify": "^3.2.0",
|
||||||
"@types/node": "25.2.3",
|
"@types/node": "25.2.3",
|
||||||
"@vitejs/plugin-vue": "6.0.4",
|
"@vitejs/plugin-vue": "6.0.4",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
|
||||||
"@vitest/ui": "^4.0.18",
|
|
||||||
"@vue/eslint-config-prettier": "10.2.0",
|
"@vue/eslint-config-prettier": "10.2.0",
|
||||||
"@vue/test-utils": "^2.4.6",
|
|
||||||
"@vue/tsconfig": "0.8.1",
|
"@vue/tsconfig": "0.8.1",
|
||||||
"eslint": "^10.0.0",
|
"eslint": "^10.0.0",
|
||||||
"eslint-plugin-vue": "10.7.0",
|
"eslint-plugin-vue": "10.7.0",
|
||||||
"jsdom": "^28.0.0",
|
|
||||||
"prettier": "3.8.1",
|
"prettier": "3.8.1",
|
||||||
"sass": "1.97.3",
|
"sass": "1.97.3",
|
||||||
"sass-loader": "16.0.7",
|
"sass-loader": "16.0.7",
|
||||||
@@ -58,7 +50,6 @@
|
|||||||
"typescript-eslint": "^8.55.0",
|
"typescript-eslint": "^8.55.0",
|
||||||
"vite": "7.3.1",
|
"vite": "7.3.1",
|
||||||
"vite-plugin-static-copy": "^3.2.0",
|
"vite-plugin-static-copy": "^3.2.0",
|
||||||
"vitest": "^4.0.18",
|
|
||||||
"vue-cli-plugin-vuetify": "2.5.8",
|
"vue-cli-plugin-vuetify": "2.5.8",
|
||||||
"vue-tsc": "^3.2.4"
|
"vue-tsc": "^3.2.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||||
colors="true"
|
colors="true"
|
||||||
failOnDeprecation="true"
|
failOnDeprecation="true"
|
||||||
failOnNotice="true"
|
failOnNotice="true"
|
||||||
failOnWarning="true"
|
failOnWarning="true"
|
||||||
bootstrap="bootstrap.php"
|
bootstrap="tests/php/bootstrap.php"
|
||||||
cacheDirectory="../../.phpunit.cache"
|
cacheDirectory=".phpunit.cache"
|
||||||
>
|
>
|
||||||
<php>
|
<php>
|
||||||
<ini name="display_errors" value="1" />
|
<ini name="display_errors" value="1" />
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
</php>
|
</php>
|
||||||
|
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Unit Tests">
|
<testsuite name="Project Test Suite">
|
||||||
<directory>unit</directory>
|
<directory>tests/php</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
@@ -29,8 +29,7 @@
|
|||||||
restrictWarnings="true"
|
restrictWarnings="true"
|
||||||
>
|
>
|
||||||
<include>
|
<include>
|
||||||
<directory>../../core/lib</directory>
|
<directory>src</directory>
|
||||||
<directory>../../shared/lib</directory>
|
|
||||||
</include>
|
</include>
|
||||||
|
|
||||||
<deprecationTrigger>
|
<deprecationTrigger>
|
||||||
@@ -23,8 +23,8 @@ use KTXF\Mail\Collection\CollectionMutableInterface;
|
|||||||
interface ServiceCollectionMutableInterface extends ServiceBaseInterface {
|
interface ServiceCollectionMutableInterface extends ServiceBaseInterface {
|
||||||
|
|
||||||
public const CAPABILITY_COLLECTION_CREATE = 'CollectionCreate';
|
public const CAPABILITY_COLLECTION_CREATE = 'CollectionCreate';
|
||||||
public const CAPABILITY_COLLECTION_UPDATE = 'CollectionUpdate';
|
public const CAPABILITY_COLLECTION_MODIFY = 'CollectionModify';
|
||||||
public const CAPABILITY_COLLECTION_DELETE = 'CollectionDelete';
|
public const CAPABILITY_COLLECTION_DESTROY = 'CollectionDestroy';
|
||||||
public const CAPABILITY_COLLECTION_MOVE = 'CollectionMove';
|
public const CAPABILITY_COLLECTION_MOVE = 'CollectionMove';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,29 +50,29 @@ interface ServiceCollectionMutableInterface extends ServiceBaseInterface {
|
|||||||
public function collectionCreate(string|int|null $location, CollectionMutableInterface $collection, array $options = []): CollectionBaseInterface;
|
public function collectionCreate(string|int|null $location, CollectionMutableInterface $collection, array $options = []): CollectionBaseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates an existing collection
|
* Modifies an existing collection
|
||||||
*
|
*
|
||||||
* @since 2025.05.01
|
* @since 2025.05.01
|
||||||
*
|
*
|
||||||
* @param string|int $identifier Collection ID
|
* @param string|int $identifier Collection ID
|
||||||
* @param CollectionMutableInterface $collection Updated collection data
|
* @param CollectionMutableInterface $collection Updated collection data
|
||||||
*
|
*
|
||||||
* @return CollectionBaseInterface Updated collection
|
* @return CollectionBaseInterface Modified collection
|
||||||
*/
|
*/
|
||||||
public function collectionUpdate(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface;
|
public function collectionModify(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a collection
|
* Destroys a collection
|
||||||
*
|
*
|
||||||
* @since 2025.05.01
|
* @since 2025.05.01
|
||||||
*
|
*
|
||||||
* @param string|int $identifier Collection ID
|
* @param string|int $identifier Collection ID
|
||||||
* @param bool $force Force deletion even if not empty
|
* @param bool $force Force destruction even if not empty
|
||||||
* @param bool $recursive Recursively delete contents
|
* @param bool $recursive Recursively destroy contents
|
||||||
*
|
*
|
||||||
* @return bool True if deleted
|
* @return bool True if destroyed
|
||||||
*/
|
*/
|
||||||
public function collectionDelete(string|int $identifier, bool $force = false, bool $recursive = false): bool;
|
public function collectionDestroy(string|int $identifier, bool $force = false, bool $recursive = false): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves a collection to a new parent
|
* Moves a collection to a new parent
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
import { describe, it, expect } from 'vitest'
|
|
||||||
|
|
||||||
describe('Basic Tests', () => {
|
|
||||||
it('should perform basic assertion', () => {
|
|
||||||
expect(true).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should test array operations', () => {
|
|
||||||
const array = ['foo', 'bar', 'baz']
|
|
||||||
|
|
||||||
expect(array).toHaveLength(3)
|
|
||||||
expect(array).toContain('bar')
|
|
||||||
expect(array[0]).toBe('foo')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should test string operations', () => {
|
|
||||||
const string = 'Hello, World!'
|
|
||||||
|
|
||||||
expect(string).toContain('World')
|
|
||||||
expect(string.length).toBe(13)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should test object operations', () => {
|
|
||||||
const obj = { foo: 'bar', count: 42 }
|
|
||||||
|
|
||||||
expect(obj).toHaveProperty('foo')
|
|
||||||
expect(obj.foo).toBe('bar')
|
|
||||||
expect(obj.count).toBeGreaterThan(40)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import { fileURLToPath } from 'node:url'
|
|
||||||
import { defineConfig, configDefaults } from 'vitest/config'
|
|
||||||
import vue from '@vitejs/plugin-vue'
|
|
||||||
import vuetify from 'vite-plugin-vuetify'
|
|
||||||
import path from 'path'
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
|
||||||
const __dirname = path.dirname(__filename)
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [vue(), vuetify()],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'@KTXC': path.resolve(__dirname, '../../core/src'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
test: {
|
|
||||||
environment: 'jsdom',
|
|
||||||
exclude: [...configDefaults.exclude, 'e2e/**'],
|
|
||||||
root: fileURLToPath(new URL('../../', import.meta.url)),
|
|
||||||
coverage: {
|
|
||||||
provider: 'v8',
|
|
||||||
reporter: ['text', 'json', 'html'],
|
|
||||||
exclude: [
|
|
||||||
'node_modules/',
|
|
||||||
'tests/',
|
|
||||||
'**/*.d.ts',
|
|
||||||
'**/*.config.*',
|
|
||||||
'**/dist/**',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user