parent
b1dbf8235b
commit
832895f897
@ -1,4 +0,0 @@ |
|||||||
# define your env variables for the test env here |
|
||||||
KERNEL_CLASS='Chamilo\Kernel' |
|
||||||
APP_SECRET='s$cretf0rt3st' |
|
||||||
SYMFONY_DEPRECATIONS_HELPER=999999 |
|
||||||
@ -0,0 +1,86 @@ |
|||||||
|
<template> |
||||||
|
<v-form> |
||||||
|
<v-container fluid> |
||||||
|
<v-row> |
||||||
|
<v-col cols="12" sm="6" md="6"> |
||||||
|
<v-file-input v-if="typeIsFile" v-model="item.resourceFile" show-size label="File upload"></v-file-input> |
||||||
|
<input type="hidden" v-model="item.parentResourceNode" /> |
||||||
|
</v-col> |
||||||
|
</v-row> |
||||||
|
</v-container> |
||||||
|
</v-form> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import has from 'lodash/has'; |
||||||
|
import { validationMixin } from 'vuelidate'; |
||||||
|
import { required } from 'vuelidate/lib/validators'; |
||||||
|
import { mapActions } from 'vuex'; |
||||||
|
import { mapFields } from 'vuex-map-fields'; |
||||||
|
|
||||||
|
export default { |
||||||
|
name: 'DocumentsFormUpload', |
||||||
|
mixins: [validationMixin], |
||||||
|
props: { |
||||||
|
values: { |
||||||
|
type: Object, |
||||||
|
required: true |
||||||
|
}, |
||||||
|
errors: { |
||||||
|
type: Object, |
||||||
|
default: () => {} |
||||||
|
}, |
||||||
|
initialValues: { |
||||||
|
type: Object, |
||||||
|
default: () => {} |
||||||
|
}, |
||||||
|
type: { |
||||||
|
type: String, |
||||||
|
} |
||||||
|
}, |
||||||
|
created () { |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
parentResourceNode: null, |
||||||
|
resourceFile: null, |
||||||
|
}; |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
// eslint-disable-next-line |
||||||
|
item() { |
||||||
|
return this.initialValues || this.values; |
||||||
|
}, |
||||||
|
titleErrors() { |
||||||
|
const errors = []; |
||||||
|
console.log('errors'); |
||||||
|
if (this.typeIsFile) { |
||||||
|
console.log('empty'); |
||||||
|
return errors; |
||||||
|
} |
||||||
|
|
||||||
|
if (!this.$v.item.title.$dirty) return errors; |
||||||
|
has(this.violations, 'title') && errors.push(this.violations.title); |
||||||
|
!this.$v.item.title.required && errors.push(this.$t('Field is required')); |
||||||
|
|
||||||
|
return errors; |
||||||
|
}, |
||||||
|
typeIsFile() { |
||||||
|
return this.type === 'file'; |
||||||
|
}, |
||||||
|
violations() { |
||||||
|
return this.errors || {}; |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
}, |
||||||
|
validations: { |
||||||
|
item: { |
||||||
|
parentResourceNode: { |
||||||
|
}, |
||||||
|
resourceFile: { |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
|
</script> |
||||||
@ -1,34 +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="http://schema.phpunit.de/6.5/phpunit.xsd" |
|
||||||
backupGlobals="false" |
|
||||||
colors="true" |
|
||||||
bootstrap="config/bootstrap.php" |
|
||||||
> |
|
||||||
<php> |
|
||||||
<ini name="error_reporting" value="-1" /> |
|
||||||
<ini name="display_errors" value="true"/> |
|
||||||
<server name="APP_ENV" value="test" force="true" /> |
|
||||||
<server name="SHELL_VERBOSITY" value="-1" /> |
|
||||||
<server name="SYMFONY_PHPUNIT_REMOVE" value="" /> |
|
||||||
<server name="SYMFONY_PHPUNIT_VERSION" value="7.5" /> |
|
||||||
</php> |
|
||||||
|
|
||||||
<testsuites> |
|
||||||
<testsuite name="Project Test Suite"> |
|
||||||
<directory>tests</directory> |
|
||||||
</testsuite> |
|
||||||
</testsuites> |
|
||||||
|
|
||||||
<filter> |
|
||||||
<whitelist> |
|
||||||
<directory>src</directory> |
|
||||||
</whitelist> |
|
||||||
</filter> |
|
||||||
|
|
||||||
<listeners> |
|
||||||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" /> |
|
||||||
</listeners> |
|
||||||
</phpunit> |
|
||||||
Loading…
Reference in new issue