Compare commits
1 Commits
main
..
a1d97ce621
| Author | SHA1 | Date | |
|---|---|---|---|
| a1d97ce621 |
@@ -1,58 +0,0 @@
|
|||||||
name: Build Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Retrieve Server Install Action
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/action-server-install
|
|
||||||
ref: main
|
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install Server
|
|
||||||
uses: ./action-server-install
|
|
||||||
with:
|
|
||||||
install-php: 'false'
|
|
||||||
install-node: 'true'
|
|
||||||
php-version: '8.5'
|
|
||||||
node-version: '24'
|
|
||||||
server-path: './server'
|
|
||||||
|
|
||||||
- name: Install Mail Manager
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/mail_manager
|
|
||||||
ref: main
|
|
||||||
path: server/modules/mail_manager
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install People Manager
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/people_manager
|
|
||||||
ref: main
|
|
||||||
path: server/modules/people_manager
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Checkout Pull Request
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
path: server/modules/mail
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
name: JS Unit Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Retrieve Server Install Action
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/action-server-install
|
|
||||||
ref: main
|
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install Server
|
|
||||||
uses: ./action-server-install
|
|
||||||
with:
|
|
||||||
install-php: 'false'
|
|
||||||
install-node: 'true'
|
|
||||||
php-version: '8.5'
|
|
||||||
node-version: '24'
|
|
||||||
server-path: './server'
|
|
||||||
|
|
||||||
- name: Install Mail Manager
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/mail_manager
|
|
||||||
ref: main
|
|
||||||
path: server/modules/mail_manager
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install People Manager
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/people_manager
|
|
||||||
ref: main
|
|
||||||
path: server/modules/people_manager
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Checkout Pull Request
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
path: server/modules/mail
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: npm run test:unit
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
name: PHP Integration Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Integration Tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
mongo:
|
|
||||||
image: mongo:7
|
|
||||||
options: >-
|
|
||||||
--health-cmd "mongosh --quiet --eval \"db.adminCommand('ping')\""
|
|
||||||
--health-interval 5s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 12
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Retrieve Server Install Action
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/action-server-install
|
|
||||||
ref: main
|
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install server
|
|
||||||
uses: ./action-server-install
|
|
||||||
with:
|
|
||||||
install-php: 'true'
|
|
||||||
php-version: '8.5'
|
|
||||||
server-path: './server'
|
|
||||||
database-uri: 'mongodb://mongo:27017/?tls=false'
|
|
||||||
database-name: 'ktrix_ci'
|
|
||||||
app-environment: 'test'
|
|
||||||
|
|
||||||
- name: Checkout module under test
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
||||||
path: server/modules/mail
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install module dependencies
|
|
||||||
run: composer install --prefer-dist --no-progress
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
|
|
||||||
- name: Install and enable module
|
|
||||||
working-directory: server
|
|
||||||
run: |
|
|
||||||
php bin/console module:install mail
|
|
||||||
php bin/console module:enable mail
|
|
||||||
|
|
||||||
- name: Run integration tests
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
run: composer test:integration
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
name: PHP Unit Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Retrieve Server Install Action
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: Nodarx/action-server-install
|
|
||||||
ref: main
|
|
||||||
path: action-server-install
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install Server
|
|
||||||
uses: ./action-server-install
|
|
||||||
with:
|
|
||||||
install-php: 'true'
|
|
||||||
install-node: 'false'
|
|
||||||
php-version: '8.5'
|
|
||||||
node-version: '24'
|
|
||||||
server-path: './server'
|
|
||||||
|
|
||||||
- name: Checkout Pull Request
|
|
||||||
uses: actions/checkout@v6.0.2
|
|
||||||
with:
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
path: server/modules/mail
|
|
||||||
github-server-url: https://git.ktrix.dev
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --prefer-dist --no-progress
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: composer test:unit
|
|
||||||
working-directory: server/modules/mail
|
|
||||||
+4
-1
@@ -15,7 +15,10 @@ node_modules/
|
|||||||
/vendor/
|
/vendor/
|
||||||
/lib/vendor/
|
/lib/vendor/
|
||||||
coverage/
|
coverage/
|
||||||
*.cache
|
phpunit.xml.cache
|
||||||
|
.phpunit.result.cache
|
||||||
|
.php-cs-fixer.cache
|
||||||
|
.phpstan.cache
|
||||||
.phpactor/
|
.phpactor/
|
||||||
|
|
||||||
# Editors
|
# Editors
|
||||||
|
|||||||
+1
-13
@@ -9,18 +9,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.3"
|
"php": ">=8.2"
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^12.0"
|
|
||||||
},
|
|
||||||
"autoload-dev": {
|
|
||||||
"psr-4": {
|
|
||||||
"KTXT\\Mail\\Tests\\": "tests/php/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test:unit": "phpunit --configuration tests/php/phpunit.xml --testsuite \"Unit Tests\" --colors=always --testdox",
|
|
||||||
"test:integration": "phpunit --configuration tests/php/phpunit.xml --testsuite \"Integration Tests\" --colors=always --testdox"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+3
-1685
File diff suppressed because it is too large
Load Diff
@@ -7,8 +7,8 @@ namespace KTXM\Mail\Controllers;
|
|||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use KTXC\Http\Response\JsonResponse;
|
use KTXC\Http\Response\JsonResponse;
|
||||||
use KTXC\Http\Response\Response;
|
use KTXC\Http\Response\Response;
|
||||||
use KTXC\Context\IdentityContextInterface;
|
use KTXC\SessionIdentity;
|
||||||
use KTXC\Context\TenantContextInterface;
|
use KTXC\SessionTenant;
|
||||||
use KTXF\Controller\ControllerAbstract;
|
use KTXF\Controller\ControllerAbstract;
|
||||||
use KTXF\Routing\Attributes\AuthenticatedRoute;
|
use KTXF\Routing\Attributes\AuthenticatedRoute;
|
||||||
use KTXM\Mail\CompositionManager;
|
use KTXM\Mail\CompositionManager;
|
||||||
@@ -18,8 +18,8 @@ use Throwable;
|
|||||||
final class CompositionController extends ControllerAbstract {
|
final class CompositionController extends ControllerAbstract {
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TenantContextInterface $tenantContext,
|
private readonly SessionTenant $tenantIdentity,
|
||||||
private readonly IdentityContextInterface $identityContext,
|
private readonly SessionIdentity $userIdentity,
|
||||||
private readonly CompositionManager $compositionManager,
|
private readonly CompositionManager $compositionManager,
|
||||||
private readonly LoggerInterface $logger,
|
private readonly LoggerInterface $logger,
|
||||||
) {}
|
) {}
|
||||||
@@ -31,8 +31,8 @@ final class CompositionController extends ControllerAbstract {
|
|||||||
string|null $operation = null,
|
string|null $operation = null,
|
||||||
array|null $data = null,
|
array|null $data = null,
|
||||||
): Response {
|
): Response {
|
||||||
$tenantId = $this->tenantContext->identifier();
|
$tenantId = $this->tenantIdentity->identifier();
|
||||||
$userId = $this->identityContext->identifier();
|
$userId = $this->userIdentity->identifier();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($operation === null) {
|
if ($operation === null) {
|
||||||
|
|||||||
Generated
+520
-2307
File diff suppressed because it is too large
Load Diff
+3
-11
@@ -11,11 +11,7 @@
|
|||||||
"dev": "vite build --mode development --config vite.config.ts",
|
"dev": "vite build --mode development --config vite.config.ts",
|
||||||
"watch": "vite build --mode development --watch --config vite.config.ts",
|
"watch": "vite build --mode development --watch --config vite.config.ts",
|
||||||
"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",
|
|
||||||
"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": {
|
"dependencies": {
|
||||||
"@tiptap/vue-3": "^3.0.0",
|
"@tiptap/vue-3": "^3.0.0",
|
||||||
@@ -32,12 +28,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^6.0.0",
|
"@vitejs/plugin-vue": "^6.0.0",
|
||||||
"@vue/tsconfig": "^0.9.0",
|
"@vue/tsconfig": "^0.9.0",
|
||||||
"typescript": "~6.0.0",
|
"typescript": "^6.0.0",
|
||||||
"vite": "^8.0.0",
|
"vite": "^8.0.0",
|
||||||
"vue-tsc": "^3.0.0",
|
"vue-tsc": "^3.0.0"
|
||||||
"@vitest/coverage-v8": "^4.1.6",
|
|
||||||
"@vue/test-utils": "^2.4.10",
|
|
||||||
"jsdom": "^29.1.1",
|
|
||||||
"vitest": "^4.1.6"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComposerSenderIdentity } from '@/types/composer';
|
import type { ComposerSenderIdentity } from '@/types/composer';
|
||||||
import { computed, watch } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue: ComposerSenderIdentity | null
|
modelValue: ComposerSenderIdentity | null
|
||||||
@@ -27,6 +27,11 @@ const items = computed<SenderListItem[]>(() => {
|
|||||||
|
|
||||||
const selectedValue = computed(() => props.modelValue?.address ?? null)
|
const selectedValue = computed(() => props.modelValue?.address ?? null)
|
||||||
|
|
||||||
|
const singleOptionLabel = computed(() => {
|
||||||
|
const onlyOption = props.options[0]
|
||||||
|
return onlyOption ? formatSenderLabel(onlyOption.label, onlyOption.address) : ''
|
||||||
|
})
|
||||||
|
|
||||||
const errorMessages = computed(() => {
|
const errorMessages = computed(() => {
|
||||||
if (props.options.length === 0) {
|
if (props.options.length === 0) {
|
||||||
return ['No send-capable account is available.']
|
return ['No send-capable account is available.']
|
||||||
@@ -35,18 +40,6 @@ const errorMessages = computed(() => {
|
|||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
|
|
||||||
// Auto-select (and keep selected) the only send-capable account, since
|
|
||||||
// there's no "from" UI shown for the user to pick it themselves.
|
|
||||||
watch(
|
|
||||||
() => props.options,
|
|
||||||
options => {
|
|
||||||
if (options.length === 1 && props.modelValue?.address !== options[0].address) {
|
|
||||||
emit('update:modelValue', options[0])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true },
|
|
||||||
)
|
|
||||||
|
|
||||||
function handleUpdate(value: string | null) {
|
function handleUpdate(value: string | null) {
|
||||||
const match = value ? props.options.find(o => o.address === value) ?? null : null
|
const match = value ? props.options.find(o => o.address === value) ?? null : null
|
||||||
emit('update:modelValue', match)
|
emit('update:modelValue', match)
|
||||||
@@ -58,8 +51,19 @@ function formatSenderLabel(label: string | null | undefined, address: string): s
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="options.length !== 1" class="composer-sender px-4 pt-4 pb-0">
|
<div class="composer-sender px-4 pt-4 pb-0">
|
||||||
|
<v-text-field
|
||||||
|
v-if="options.length === 1"
|
||||||
|
:model-value="singleOptionLabel"
|
||||||
|
label="From"
|
||||||
|
variant="outlined"
|
||||||
|
density="compact"
|
||||||
|
readonly
|
||||||
|
class="mb-2"
|
||||||
|
/>
|
||||||
|
|
||||||
<v-select
|
<v-select
|
||||||
|
v-else
|
||||||
:model-value="selectedValue"
|
:model-value="selectedValue"
|
||||||
:items="items"
|
:items="items"
|
||||||
item-title="title"
|
item-title="title"
|
||||||
|
|||||||
@@ -40,11 +40,10 @@ const handleAccountSaved = async () => {
|
|||||||
<v-list-item
|
<v-list-item
|
||||||
v-for="service in servicesStore.services"
|
v-for="service in servicesStore.services"
|
||||||
:key="`${service.provider}:${service.identifier}`"
|
:key="`${service.provider}:${service.identifier}`"
|
||||||
:class="{ 'opacity-60': !service.enabled }"
|
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<v-avatar :color="service.enabled ? 'primary' : 'grey'">
|
<v-avatar color="primary">
|
||||||
<v-icon>{{ service.enabled ? 'mdi-email' : 'mdi-email-off' }}</v-icon>
|
<v-icon>mdi-email</v-icon>
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ const handleFolderCreateConfirm = async (folderName: string) => {
|
|||||||
handleFolderSelect(mutatedFolder)
|
handleFolderSelect(mutatedFolder)
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
console.error('[Mail] Failed to create folder:', error)
|
console.error('[MailPage] Failed to create folder:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ const handleFolderEditConfirm = async (folderName: string) => {
|
|||||||
handleFolderSelect(mutatedFolder)
|
handleFolderSelect(mutatedFolder)
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
console.error('[Mail] Failed to rename folder:', error)
|
console.error('[MailPage] Failed to rename folder:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ const handleFolderDeleteConfirm = async () => {
|
|||||||
try {
|
try {
|
||||||
await mailUiStore.confirmDeleteFolder()
|
await mailUiStore.confirmDeleteFolder()
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
console.error('[Mail] Failed to delete folder:', error)
|
console.error('[MailPage] Failed to delete folder:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ const handleFolderMoveConfirm = async (targetFolder: CollectionObject) => {
|
|||||||
try {
|
try {
|
||||||
await mailUiStore.confirmMoveFolder(targetFolder)
|
await mailUiStore.confirmMoveFolder(targetFolder)
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
console.error('[Mail] Failed to move folder:', error)
|
console.error('[MailPage] Failed to move folder:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-1
@@ -2,7 +2,7 @@ const routes = [
|
|||||||
{
|
{
|
||||||
name: 'mail',
|
name: 'mail',
|
||||||
path: '/',
|
path: '/',
|
||||||
component: () => import('@/pages/Main.vue'),
|
component: () => import('@/pages/MailPage.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Mail',
|
title: 'Mail',
|
||||||
requiresAuth: true,
|
requiresAuth: true,
|
||||||
|
|||||||
@@ -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 path from 'path'
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
|
||||||
const __dirname = path.dirname(__filename)
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [vue()],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'@': path.resolve(__dirname, '../../src'),
|
|
||||||
'@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/**',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace KTXT\Mail\Tests\Integration;
|
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
class BaseTest extends TestCase
|
|
||||||
{
|
|
||||||
public function testBasicAssertion(): void
|
|
||||||
{
|
|
||||||
$this->assertTrue(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testArrayOperations(): void
|
|
||||||
{
|
|
||||||
$array = ['foo' => 'bar'];
|
|
||||||
|
|
||||||
$this->assertArrayHasKey('foo', $array);
|
|
||||||
$this->assertEquals('bar', $array['foo']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testStringOperations(): void
|
|
||||||
{
|
|
||||||
$string = 'Hello, World!';
|
|
||||||
|
|
||||||
$this->assertStringContainsString('World', $string);
|
|
||||||
$this->assertEquals(13, strlen($string));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace KTXT\Mail\Tests\Unit;
|
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
class BaseTest extends TestCase
|
|
||||||
{
|
|
||||||
public function testBasicAssertion(): void
|
|
||||||
{
|
|
||||||
$this->assertTrue(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testArrayOperations(): void
|
|
||||||
{
|
|
||||||
$array = ['foo' => 'bar'];
|
|
||||||
|
|
||||||
$this->assertArrayHasKey('foo', $array);
|
|
||||||
$this->assertEquals('bar', $array['foo']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testStringOperations(): void
|
|
||||||
{
|
|
||||||
$string = 'Hello, World!';
|
|
||||||
|
|
||||||
$this->assertStringContainsString('World', $string);
|
|
||||||
$this->assertEquals(13, strlen($string));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require dirname(__DIR__, 2).'/vendor/autoload.php';
|
|
||||||
|
|
||||||
// When this module is checked out inside a full server (server/modules/<handle>,
|
|
||||||
// as it is in CI and in this monorepo checkout), also load the server's own
|
|
||||||
// core/shared autoloader so tests can reference framework (KTXC/KTXF) types.
|
|
||||||
// Standalone module checkouts without a server alongside them skip this.
|
|
||||||
define('SERVER_ROOT', dirname(__DIR__, 4));
|
|
||||||
$serverAutoload = SERVER_ROOT . '/vendor/autoload.php';
|
|
||||||
if (is_file($serverAutoload)) {
|
|
||||||
require $serverAutoload;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_SERVER['APP_DEBUG']) && $_SERVER['APP_DEBUG']) {
|
|
||||||
umask(0000);
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!-- 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"
|
|
||||||
colors="true"
|
|
||||||
failOnDeprecation="true"
|
|
||||||
failOnNotice="true"
|
|
||||||
failOnWarning="true"
|
|
||||||
bootstrap="bootstrap.php"
|
|
||||||
cacheDirectory="../../.phpunit.cache"
|
|
||||||
>
|
|
||||||
<php>
|
|
||||||
<ini name="display_errors" value="1" />
|
|
||||||
<ini name="error_reporting" value="-1" />
|
|
||||||
<server name="APP_ENV" value="test" force="true" />
|
|
||||||
<server name="SHELL_VERBOSITY" value="-1" />
|
|
||||||
</php>
|
|
||||||
|
|
||||||
<testsuites>
|
|
||||||
<testsuite name="Unit Tests">
|
|
||||||
<directory>Unit</directory>
|
|
||||||
</testsuite>
|
|
||||||
<testsuite name="Integration Tests">
|
|
||||||
<directory>Integration</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
|
|
||||||
<source ignoreSuppressionOfDeprecations="true"
|
|
||||||
ignoreIndirectDeprecations="true"
|
|
||||||
restrictNotices="true"
|
|
||||||
restrictWarnings="true"
|
|
||||||
>
|
|
||||||
<include>
|
|
||||||
<directory>../../lib</directory>
|
|
||||||
</include>
|
|
||||||
</source>
|
|
||||||
|
|
||||||
<extensions>
|
|
||||||
</extensions>
|
|
||||||
</phpunit>
|
|
||||||
Reference in New Issue
Block a user