Compare commits

..

11 Commits

Author SHA1 Message Date
b9c82d9923 chore(deps): update eslint monorepo to v10
Some checks failed
Build Test / build (pull_request) Failing after 7s
JS Unit Tests / test (pull_request) Failing after 7s
PHP Unit Tests / test (pull_request) Successful in 38s
2026-02-14 17:59:09 +00:00
224d221568 Merge pull request 'chore(deps): update dependency mongodb/mongodb to v2.2.0' (#19) from renovate/mongodb-mongodb-2.x-lockfile into main
All checks were successful
Renovate / renovate (push) Successful in 1m14s
Reviewed-on: #19
2026-02-14 17:58:53 +00:00
ef15838047 chore(deps): update dependency mongodb/mongodb to v2.2.0
All checks were successful
JS Unit Tests / test (pull_request) Successful in 12s
Build Test / build (pull_request) Successful in 17s
PHP Unit Tests / test (pull_request) Successful in 40s
2026-02-14 17:57:57 +00:00
4ee8e73200 Merge pull request 'chore: implement basic tests' (#24) from chore/standardize-workflows-2 into main
Reviewed-on: #24
2026-02-14 17:53:23 +00:00
40a30b8a87 chore: implement basic tests
All checks were successful
JS Unit Tests / test (pull_request) Successful in 10s
Build Test / build (pull_request) Successful in 14s
PHP Unit Tests / test (pull_request) Successful in 45s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-14 12:51:57 -05:00
3e69af7e34 Merge pull request 'chore(deps): update dependency phpunit/phpunit to v13' (#20) from renovate/phpunit-phpunit-13.x into main
Reviewed-on: #20
2026-02-14 17:03:02 +00:00
aab6aeeeae Merge pull request 'chore: standardize workflows' (#23) from chore/standardize-workflows into main
Reviewed-on: #23
2026-02-14 17:02:40 +00:00
c9ef9be24c chore: standardize workflows
All checks were successful
Build Test / build (pull_request) Successful in 16s
PHP Tests / test (pull_request) Successful in 44s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-14 12:01:23 -05:00
7f5a9300d4 chore(deps): update dependency phpunit/phpunit to v13
All checks were successful
Build Test / build (pull_request) Successful in 16s
PHP Tests / test (pull_request) Successful in 43s
2026-02-14 16:55:18 +00:00
273f2ad88b Merge pull request 'chore: standardize protocol' (#22) from chore/standardize-protocol into main
Reviewed-on: #22
2026-02-14 16:54:35 +00:00
90a45aee7c chore: standardize protocol
All checks were successful
Build Test / build (pull_request) Successful in 14s
PHP Tests / test (pull_request) Successful in 55s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-14 11:48:06 -05:00
14 changed files with 2110 additions and 359 deletions

23
.github/workflows/js-unit-tests.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
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

View File

@@ -1,4 +1,4 @@
name: PHP Tests
name: PHP Unit Tests
on:
pull_request:
@@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v6.0.2
- name: Set up PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
php-version: '8.5'
tools: composer:v2
@@ -21,4 +21,4 @@ jobs:
run: composer install --prefer-dist --no-progress
- name: Run tests
run: composer test
run: composer test:unit

3
.gitignore vendored
View File

@@ -15,9 +15,8 @@ node_modules/
# Backend development
/vendor/
coverage/
phpunit.xml.cache
.phpunit.cache
.phpunit.result.cache
.phpunit.coverage
.php-cs-fixer.cache
.phpstan.cache
.phpactor/

View File

@@ -13,7 +13,7 @@
"symfony/console": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^11.0"
"phpunit/phpunit": "^13.0"
},
"config": {
"allow-plugins": {
@@ -38,6 +38,7 @@
],
"post-update-cmd": [
],
"test": "phpunit --colors=always --testdox"
"test:unit": "phpunit --configuration tests/php/phpunit.unit.xml --colors=always --testdox",
"test:coverage": "XDEBUG_MODE=coverage phpunit --configuration tests/php/phpunit.unit.xml --coverage-html .phpunit.coverage --coverage-text"
}
}

689
composer.lock generated

File diff suppressed because it is too large Load Diff

1630
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,14 +7,18 @@
"type": "module",
"scripts": {
"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: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",
"typecheck": "vue-tsc --noEmit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"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: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"
"test": "vitest run --config tests/js/vitest.config.ts",
"test:unit": "vitest run --config tests/js/vitest.config.ts",
"test:watch": "vitest watch --config tests/js/vitest.config.ts",
"test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts"
},
"dependencies": {
"@fontsource/inter": "5.2.8",
@@ -39,10 +43,14 @@
"@types/dompurify": "^3.2.0",
"@types/node": "25.2.3",
"@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/test-utils": "^2.4.6",
"@vue/tsconfig": "0.8.1",
"eslint": "^10.0.0",
"eslint-plugin-vue": "10.7.0",
"jsdom": "^28.0.0",
"prettier": "3.8.1",
"sass": "1.97.3",
"sass-loader": "16.0.7",
@@ -50,6 +58,7 @@
"typescript-eslint": "^8.55.0",
"vite": "7.3.1",
"vite-plugin-static-copy": "^3.2.0",
"vitest": "^4.0.18",
"vue-cli-plugin-vuetify": "2.5.8",
"vue-tsc": "^3.2.4"
}

View File

@@ -23,8 +23,8 @@ use KTXF\Mail\Collection\CollectionMutableInterface;
interface ServiceCollectionMutableInterface extends ServiceBaseInterface {
public const CAPABILITY_COLLECTION_CREATE = 'CollectionCreate';
public const CAPABILITY_COLLECTION_MODIFY = 'CollectionModify';
public const CAPABILITY_COLLECTION_DESTROY = 'CollectionDestroy';
public const CAPABILITY_COLLECTION_UPDATE = 'CollectionUpdate';
public const CAPABILITY_COLLECTION_DELETE = 'CollectionDelete';
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;
/**
* Modifies an existing collection
* Updates an existing collection
*
* @since 2025.05.01
*
* @param string|int $identifier Collection ID
* @param CollectionMutableInterface $collection Updated collection data
*
* @return CollectionBaseInterface Modified collection
* @return CollectionBaseInterface Updated collection
*/
public function collectionModify(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface;
public function collectionUpdate(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface;
/**
* Destroys a collection
* Deletes a collection
*
* @since 2025.05.01
*
* @param string|int $identifier Collection ID
* @param bool $force Force destruction even if not empty
* @param bool $recursive Recursively destroy contents
* @param bool $force Force deletion even if not empty
* @param bool $recursive Recursively delete contents
*
* @return bool True if destroyed
* @return bool True if deleted
*/
public function collectionDestroy(string|int $identifier, bool $force = false, bool $recursive = false): bool;
public function collectionDelete(string|int $identifier, bool $force = false, bool $recursive = false): bool;
/**
* Moves a collection to a new parent

View File

@@ -0,0 +1,30 @@
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)
})
})

33
tests/js/vitest.config.ts Normal file
View File

@@ -0,0 +1,33 @@
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/**',
],
},
},
})

View File

@@ -2,13 +2,13 @@
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<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"
failOnDeprecation="true"
failOnNotice="true"
failOnWarning="true"
bootstrap="tests/php/bootstrap.php"
cacheDirectory=".phpunit.cache"
bootstrap="bootstrap.php"
cacheDirectory="../../.phpunit.cache"
>
<php>
<ini name="display_errors" value="1" />
@@ -18,8 +18,8 @@
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests/php</directory>
<testsuite name="Unit Tests">
<directory>unit</directory>
</testsuite>
</testsuites>
@@ -29,7 +29,8 @@
restrictWarnings="true"
>
<include>
<directory>src</directory>
<directory>../../core/lib</directory>
<directory>../../shared/lib</directory>
</include>
<deprecationTrigger>