-
+
diff --git a/tasks/assets.js b/tasks/assets.js
index 0b5ed1022a..bf8759635a 100644
--- a/tasks/assets.js
+++ b/tasks/assets.js
@@ -1,9 +1,7 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
const gulp = require('gulp');
-const {config} = require('./config');
+const { config } = require('./config');
-const assetsCopy = () =>
- gulp.src(config.paths.assets.src)
- .pipe(gulp.dest(config.paths.static));
+const assetsCopy = () => gulp.src(config.paths.assets.src).pipe(gulp.dest(config.paths.static));
exports.assets = gulp.series(assetsCopy);
diff --git a/tasks/common.js b/tasks/common.js
index 70484f7201..df934a3d29 100644
--- a/tasks/common.js
+++ b/tasks/common.js
@@ -3,11 +3,9 @@ const gulp = require('gulp');
const rimraf = require('gulp-rimraf');
const fs = require('node-fs');
-const {config} = require('./config');
+const { config } = require('./config');
-exports.del = (dir) =>
- gulp.src(dir, {read: false, allowEmpty: true})
- .pipe(rimraf());
+exports.del = (dir) => gulp.src(dir, { read: false, allowEmpty: true }).pipe(rimraf());
exports.copy = (sFile, sNewFile, done) => {
fs.writeFileSync(sNewFile, fs.readFileSync(sFile));
@@ -15,11 +13,11 @@ exports.copy = (sFile, sNewFile, done) => {
};
exports.zip = (srcDir, destDir, fileName) =>
- gulp.src(srcDir + '**/*')
+ gulp
+ .src(srcDir + '**/*')
.pipe(require('gulp-zip')(fileName))
.pipe(gulp.dest(destDir));
exports.getHead = () => (!config.community ? config.head.rainloop : config.head.agpl);
exports.cleanStatic = () => exports.del(config.paths.static);
-
diff --git a/tasks/config.js b/tasks/config.js
index c3adec9c81..b447adb2c9 100644
--- a/tasks/config.js
+++ b/tasks/config.js
@@ -1,6 +1,6 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
const path = require('path');
-const {argv} = require('yargs');
+const { argv } = require('yargs');
const config = {
head: {
@@ -9,7 +9,8 @@ const config = {
},
devVersion: '0.0.0',
releasesPath: 'build/dist/releases',
- community: true,
+ community: !argv.pro,
+ source: !!argv.source,
watch: false,
watchInterval: 1000,
googleCompile: false,
@@ -24,8 +25,6 @@ const config = {
paths: {}
};
-config.community = !argv.pro;
-
config.paths.globjs = 'dev/**/*.js';
config.paths.static = 'rainloop/v/' + config.devVersion + '/static/';
config.paths.staticJS = 'rainloop/v/' + config.devVersion + '/static/js/';
@@ -42,10 +41,7 @@ config.paths.less = {
src: 'dev/Styles/@Main.less',
watch: ['dev/Styles/*.less'],
options: {
- paths: [
- path.join(__dirname, 'dev', 'Styles'),
- path.join(__dirname, 'vendors', 'bootstrap', 'less')
- ]
+ paths: [path.join(__dirname, 'dev', 'Styles'), path.join(__dirname, 'vendors', 'bootstrap', 'less')]
}
}
};
@@ -71,18 +67,13 @@ config.paths.css = {
},
social: {
name: 'social.css',
- src: [
- 'vendors/fontastic/styles.css',
- 'dev/Styles/_social.css'
- ]
+ src: ['vendors/fontastic/styles.css', 'dev/Styles/_social.css']
}
};
config.paths.js = {
moment: {
- locales: [
- 'node_modules/moment/locale/*.js'
- ]
+ locales: ['node_modules/moment/locale/*.js']
},
libs: {
name: 'libs.js',
diff --git a/tasks/css.js b/tasks/css.js
index d1f3615e98..5a2d3e1ff3 100644
--- a/tasks/css.js
+++ b/tasks/css.js
@@ -1,35 +1,37 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
const gulp = require('gulp');
-const
- concat = require('gulp-concat-util'),
- rename = require('gulp-rename'),
- replace = require('gulp-replace'),
- plumber = require('gulp-plumber'),
- gulpif = require('gulp-if'),
- eol = require('gulp-eol'),
- livereload = require('gulp-livereload'),
- filter = require('gulp-filter'),
- expect = require('gulp-expect-file');
+const concat = require('gulp-concat-util');
+const rename = require('gulp-rename');
+const replace = require('gulp-replace');
+const plumber = require('gulp-plumber');
+const gulpif = require('gulp-if');
+const eol = require('gulp-eol');
+const livereload = require('gulp-livereload');
+const filter = require('gulp-filter');
+const expect = require('gulp-expect-file');
-const {config} = require('./config');
-const {del} = require('./common');
+const { config } = require('./config');
+const { del } = require('./common');
const cssClean = () => del(config.paths.staticCSS + '/*.css');
const cssMainBuild = () => {
const autoprefixer = require('gulp-autoprefixer'),
less = require('gulp-less'),
- lessFilter = filter('**/*.less', {restore: true}),
+ lessFilter = filter('**/*.less', { restore: true }),
src = config.paths.css.main.src.concat([config.paths.less.main.src]);
- return gulp.src(src)
- .pipe(expect.real({errorOnFailure: true}, src))
+ return gulp
+ .src(src)
+ .pipe(expect.real({ errorOnFailure: true }, src))
.pipe(lessFilter)
.pipe(gulpif(config.watch, plumber()))
- .pipe(less({
- 'paths': config.paths.less.main.options.paths
- }))
+ .pipe(
+ less({
+ 'paths': config.paths.less.main.options.paths
+ })
+ )
.pipe(lessFilter.restore)
.pipe(concat(config.paths.css.main.name))
.pipe(autoprefixer())
@@ -42,8 +44,9 @@ const cssMainBuild = () => {
const cssSocialBuild = () => {
const autoprefixer = require('gulp-autoprefixer'),
src = config.paths.css.social.src;
- return gulp.src(src)
- .pipe(expect.real({errorOnFailure: true}, src))
+ return gulp
+ .src(src)
+ .pipe(expect.real({ errorOnFailure: true }, src))
.pipe(concat(config.paths.css.social.name))
.pipe(autoprefixer())
.pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/'))
@@ -53,18 +56,20 @@ const cssSocialBuild = () => {
const cssMainMin = () => {
const cleanCss = require('gulp-clean-css');
- return gulp.src(config.paths.staticCSS + config.paths.css.main.name)
+ return gulp
+ .src(config.paths.staticCSS + config.paths.css.main.name)
.pipe(cleanCss())
- .pipe(rename({suffix: '.min'}))
+ .pipe(rename({ suffix: '.min' }))
.pipe(eol('\n', true))
.pipe(gulp.dest(config.paths.staticCSS));
};
const cssSocialMin = () => {
const cleanCss = require('gulp-clean-css');
- return gulp.src(config.paths.staticCSS + config.paths.css.social.name)
+ return gulp
+ .src(config.paths.staticCSS + config.paths.css.social.name)
.pipe(cleanCss())
- .pipe(rename({suffix: '.min'}))
+ .pipe(rename({ suffix: '.min' }))
.pipe(eol('\n', true))
.pipe(gulp.dest(config.paths.staticCSS));
};
diff --git a/tasks/js.js b/tasks/js.js
index 2cf24ebb7c..374c1ca88c 100644
--- a/tasks/js.js
+++ b/tasks/js.js
@@ -1,8 +1,7 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
const gulp = require('gulp');
-const
- concat = require('gulp-concat-util'),
+const concat = require('gulp-concat-util'),
header = require('gulp-header'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
@@ -14,64 +13,79 @@ const
cache = require('gulp-cached'),
expect = require('gulp-expect-file'),
size = require('gulp-size'),
+ sourcemaps = require('gulp-sourcemaps'),
gutil = require('gulp-util');
-const {config} = require('./config');
-const {del, getHead} = require('./common');
+const { config } = require('./config');
+const { del, getHead } = require('./common');
-const {webpack} = require('./webpack');
+const { webpack } = require('./webpack');
-const jsClean = () => del(config.paths.staticJS + '/**/*.js');
+const jsClean = () => del(config.paths.staticJS + '/**/*.{js,map}');
// libs
const jsLibs = () => {
const src = config.paths.js.libs.src;
- return gulp.src(src)
- .pipe(expect.real({errorOnFailure: true}, src))
- .pipe(concat(config.paths.js.libs.name, {separator: '\n\n'}))
+ return gulp
+ .src(src)
+ .pipe(expect.real({ errorOnFailure: true }, src))
+ .pipe(concat(config.paths.js.libs.name, { separator: '\n\n' }))
.pipe(eol('\n', true))
- .pipe(replace(/sourceMappingURL=[a-z0-9\.\-_]{1,20}\.map/ig, ''))
+ .pipe(replace(/sourceMappingURL=[a-z0-9.\-_]{1,20}\.map/gi, ''))
.pipe(gulp.dest(config.paths.staticJS));
};
// app
const jsApp = () =>
- gulp.src(config.paths.staticJS + config.paths.js.app.name)
+ gulp
+ .src(config.paths.staticJS + config.paths.js.app.name)
.pipe(header(getHead() + '\n'))
.pipe(eol('\n', true))
.pipe(gulp.dest(config.paths.staticJS))
.on('error', gutil.log);
const jsAdmin = () =>
- gulp.src(config.paths.staticJS + config.paths.js.admin.name)
+ gulp
+ .src(config.paths.staticJS + config.paths.js.admin.name)
.pipe(header(getHead() + '\n'))
.pipe(eol('\n', true))
.pipe(gulp.dest(config.paths.staticJS))
.on('error', gutil.log);
const jsMin = () =>
- gulp.src(config.paths.staticJS + '*.js')
- .pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
- .pipe(size({
- showFiles: true,
- showTotal: false
- }))
- .pipe(rename({suffix: '.min'}))
- .pipe(uglify({
- mangle: true,
- compress: true,
- ie8: false
- }))
+ gulp
+ .src(config.paths.staticJS + '*.js')
+ .pipe(
+ size({
+ showFiles: true,
+ showTotal: false
+ })
+ )
+ .pipe(gulpif(config.source, sourcemaps.init({ loadMaps: true })))
+ .pipe(replace(/"rainloop\/v\/([^/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
+ .pipe(rename({ suffix: '.min' }))
+ .pipe(
+ uglify({
+ mangle: true,
+ compress: true,
+ ie8: false
+ })
+ )
.pipe(eol('\n', true))
- .pipe(size({
- showFiles: true,
- showTotal: false
- }))
+ .pipe(gulpif(config.source, sourcemaps.write('./')))
+ .pipe(
+ size({
+ showFiles: true,
+ showTotal: false
+ })
+ )
.pipe(gulp.dest(config.paths.staticMinJS))
.on('error', gutil.log);
-const jsLint = () =>
- gulp.src(config.paths.globjs)
+const jsLint = (cb) => cb();
+const jsLint1 = () =>
+ gulp
+ .src(config.paths.globjs)
.pipe(cache('eslint'))
.pipe(eslint())
.pipe(gulpif(config.watch, plumber()))
diff --git a/tasks/owncloud.js b/tasks/owncloud.js
index 204e4057ab..48ae9edd51 100644
--- a/tasks/owncloud.js
+++ b/tasks/owncloud.js
@@ -5,33 +5,27 @@ const gulp = require('gulp');
const fs = require('node-fs');
const pkg = require('../package.json');
-const {config} = require('./config');
-const {copy, zip, del} = require('./common');
-const {rainloopBuild} = require('./rainloop');
+const { config } = require('./config');
+const { copy, zip, del } = require('./common');
+const { rainloopBuild } = require('./rainloop');
const owncloudCopy = () => {
- const
- versionFull = pkg.ownCloudVersion,
- dist = config.releasesPath + '/owncloud/' + versionFull + '/src/'
- ;
+ const versionFull = pkg.ownCloudVersion,
+ dist = config.releasesPath + '/owncloud/' + versionFull + '/src/';
fs.mkdirSync(dist, '0777', true);
fs.mkdirSync(dist + 'rainloop', '0777', true);
- return gulp.src('build/owncloud/rainloop-app/**/*', {base: 'build/owncloud/rainloop-app/'})
+ return gulp
+ .src('build/owncloud/rainloop-app/**/*', { base: 'build/owncloud/rainloop-app/' })
.pipe(gulp.dest(dist + 'rainloop'));
};
const owncloudCopyRainLoop = () => {
- const
- versionFull = pkg.ownCloudVersion,
- dist = config.releasesPath + '/owncloud/' + versionFull + '/src/rainloop/'
- ;
-
- if (config.rainloopBuilded && config.destPath)
- {
- return gulp.src(config.destPath + '/src/**/*', {base: config.destPath + '/src/'})
- .pipe(gulp.dest(dist + 'app/'));
+ const versionFull = pkg.ownCloudVersion,
+ dist = config.releasesPath + '/owncloud/' + versionFull + '/src/rainloop/';
+ if (config.rainloopBuilded && config.destPath) {
+ return gulp.src(config.destPath + '/src/**/*', { base: config.destPath + '/src/' }).pipe(gulp.dest(dist + 'app/'));
}
return true;
@@ -45,15 +39,17 @@ const owncloudCopyRainLoopClean = (done) => {
};
const owncloudSetup = (done) => {
- const
- versionFull = pkg.ownCloudVersion,
- dist = config.releasesPath + '/owncloud/' + versionFull + '/src/'
- ;
-
- fs.writeFileSync(dist + 'rainloop/appinfo/info.xml',
- fs.readFileSync(dist + 'rainloop/appinfo/info.xml', 'utf8')
+ const versionFull = pkg.ownCloudVersion,
+ dist = config.releasesPath + '/owncloud/' + versionFull + '/src/';
+ fs.writeFileSync(
+ dist + 'rainloop/appinfo/info.xml',
+ fs
+ .readFileSync(dist + 'rainloop/appinfo/info.xml', 'utf8')
.replace('
0.0', '
' + versionFull + '')
- .replace('
', '
' + (config.community ? 'AGPLv3' : 'RainLoop Software License') + '')
+ .replace(
+ '
',
+ '
' + (config.community ? 'AGPLv3' : 'RainLoop Software License') + ''
+ )
);
fs.writeFileSync(dist + 'rainloop/appinfo/version', versionFull);
diff --git a/tasks/rainloop.js b/tasks/rainloop.js
index 482f01ea7f..e540593ae1 100644
--- a/tasks/rainloop.js
+++ b/tasks/rainloop.js
@@ -1,47 +1,46 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
/* eslint-disable consistent-return */
-
const gulp = require('gulp');
const fs = require('node-fs');
const chmod = require('gulp-chmod');
const pkg = require('../package.json');
-const {config} = require('./config');
-const {copy, zip, del} = require('./common');
+const { config } = require('./config');
+const { copy, zip, del } = require('./common');
const rainloopCopy = () => {
- const
- versionFull = pkg.version,
- dist = config.releasesPath + '/webmail/' + versionFull + '/src/'
- ;
-
+ const versionFull = pkg.version,
+ dist = config.releasesPath + '/webmail/' + versionFull + '/src/';
fs.mkdirSync(dist, '0777', true);
fs.mkdirSync(dist + 'data');
fs.mkdirSync(dist + 'rainloop/v/' + versionFull, '0777', true);
- return gulp.src('rainloop/v/' + config.devVersion + '/**/*', {base: 'rainloop/v/' + config.devVersion})
+ return gulp
+ .src('rainloop/v/' + config.devVersion + '/**/*', { base: 'rainloop/v/' + config.devVersion })
.pipe(chmod(0o644, 0o755))
.pipe(gulp.dest(dist + 'rainloop/v/' + versionFull));
};
const rainloopSetup = (done) => {
- const
- versionFull = pkg.version,
- dist = config.releasesPath + '/webmail/' + versionFull + '/src/'
- ;
-
+ const versionFull = pkg.version,
+ dist = config.releasesPath + '/webmail/' + versionFull + '/src/';
fs.writeFileSync(dist + 'data/VERSION', versionFull);
fs.writeFileSync(dist + 'data/EMPTY', versionFull);
- fs.writeFileSync(dist + 'index.php', fs.readFileSync('index.php', 'utf8')
- .replace('\'APP_VERSION\', \'0.0.0\'', '\'APP_VERSION\', \'' + versionFull + '\'')
- .replace('\'APP_VERSION_TYPE\', \'source\'', '\'APP_VERSION_TYPE\', \'' + (config.community ? 'community' : 'standard') + '\'')
+ fs.writeFileSync(
+ dist + 'index.php',
+ fs
+ .readFileSync('index.php', 'utf8')
+ .replace("'APP_VERSION', '0.0.0'", "'APP_VERSION', '" + versionFull + "'")
+ .replace(
+ "'APP_VERSION_TYPE', 'source'",
+ "'APP_VERSION_TYPE', '" + (config.community ? 'community' : 'standard') + "'"
+ )
);
fs.writeFileSync(dist + 'rainloop/v/' + versionFull + '/index.php.root', fs.readFileSync(dist + 'index.php'));
- if (config.community)
- {
+ if (config.community) {
require('rimraf').sync(dist + 'rainloop/v/' + versionFull + '/app/libraries/RainLoop/Providers/Prem.php');
}
@@ -74,14 +73,6 @@ const rainloopClean = (done) => {
const rainloopShortName = (done) => copy(config.destPath + config.zipFile, config.destPath + config.zipFileShort, done);
-exports.rainloopBuild = gulp.series(
- rainloopCopy,
- rainloopSetup,
-);
-
-exports.rainloop = gulp.series(
- exports.rainloopBuild,
- rainloopZip,
- rainloopClean,
- rainloopShortName
-);
+exports.rainloopBuild = gulp.series(rainloopCopy, rainloopSetup);
+
+exports.rainloop = gulp.series(exports.rainloopBuild, rainloopZip, rainloopClean, rainloopShortName);
diff --git a/tasks/vendors.js b/tasks/vendors.js
index 587aa33c7c..41a26f172d 100644
--- a/tasks/vendors.js
+++ b/tasks/vendors.js
@@ -1,17 +1,15 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
-const gulp = require('gulp'),
- header = require('gulp-header'),
- stripbom = require('gulp-stripbom');
+const gulp = require('gulp');
+const header = require('gulp-header');
+const stripbom = require('gulp-stripbom');
-const {config} = require('./config');
-const {del} = require('./common');
+const { config } = require('./config');
+const { del } = require('./common');
// moment
const momentLocalesClear = () => del('rainloop/v/' + config.devVersion + '/app/localization/moment/*.js');
-const momentLocales = () =>
- gulp.src(config.paths.js.moment.locales)
- .pipe(gulp.dest(config.paths.momentLocales));
+const momentLocales = () => gulp.src(config.paths.js.moment.locales).pipe(gulp.dest(config.paths.momentLocales));
const moment = gulp.series(momentLocalesClear, momentLocales);
@@ -19,7 +17,8 @@ const moment = gulp.series(momentLocalesClear, momentLocales);
const lightgalleryFontsClear = () => del('rainloop/v/' + config.devVersion + '/static/css/fonts/lg.*');
const lightgalleryFontsCopy = () =>
- gulp.src('vendors/lightgallery/dist/fonts/lg.*')
+ gulp
+ .src('vendors/lightgallery/dist/fonts/lg.*')
.pipe(gulp.dest('rainloop/v/' + config.devVersion + '/static/css/fonts'));
const lightgallery = gulp.series(lightgalleryFontsClear, lightgalleryFontsCopy);
@@ -28,7 +27,8 @@ const lightgallery = gulp.series(lightgalleryFontsClear, lightgalleryFontsCopy);
const fontasticFontsClear = () => del('rainloop/v/' + config.devVersion + '/static/css/fonts/rainloop.*');
const fontasticFontsCopy = () =>
- gulp.src('vendors/fontastic/fonts/rainloop.*')
+ gulp
+ .src('vendors/fontastic/fonts/rainloop.*')
.pipe(gulp.dest('rainloop/v/' + config.devVersion + '/static/css/fonts'));
const fontastic = gulp.series(fontasticFontsClear, fontasticFontsCopy);
@@ -37,18 +37,26 @@ const fontastic = gulp.series(fontasticFontsClear, fontasticFontsCopy);
const ckeditorClear = () => del('rainloop/v/' + config.devVersion + '/static/ckeditor');
const ckeditorCopy = () =>
- gulp.src(['vendors/ckeditor/**/*', '!vendors/ckeditor/samples{,/**}', '!vendors/ckeditor/adapters{,/**}', '!vendors/ckeditor/*.md'])
+ gulp
+ .src([
+ 'vendors/ckeditor/**/*',
+ '!vendors/ckeditor/samples{,/**}',
+ '!vendors/ckeditor/adapters{,/**}',
+ '!vendors/ckeditor/*.md'
+ ])
.pipe(gulp.dest('rainloop/v/' + config.devVersion + '/static/ckeditor'));
const ckeditorCopyPlugins = () =>
- gulp.src('vendors/ckeditor-plugins/**/*')
+ gulp
+ .src('vendors/ckeditor-plugins/**/*')
.pipe(gulp.dest('rainloop/v/' + config.devVersion + '/static/ckeditor/plugins'));
const ckeditorSetup = () =>
- gulp.src('rainloop/v/' + config.devVersion + '/static/ckeditor/*.js')
+ gulp
+ .src('rainloop/v/' + config.devVersion + '/static/ckeditor/*.js')
.pipe(stripbom())
// eslint-disable-next-line quotes
- .pipe(header("\uFEFF")) // BOM
+ .pipe(header('\uFEFF')) // BOM
.pipe(gulp.dest('rainloop/v/' + config.devVersion + '/static/ckeditor'));
const ckeditor = gulp.series(ckeditorClear, ckeditorCopy, ckeditorCopyPlugins, ckeditorSetup);
diff --git a/tasks/webpack.js b/tasks/webpack.js
index 878627c665..4452dfd211 100644
--- a/tasks/webpack.js
+++ b/tasks/webpack.js
@@ -2,7 +2,7 @@
const webpack = require('webpack');
const gutil = require('gulp-util');
-const {config} = require('./config');
+const { config } = require('./config');
const webpackCfgBuilder = require('../webpack.config.builder.js');
@@ -34,8 +34,5 @@ const webpackCallback = (done) => (err, stats) => {
};
exports.webpack = (done) => {
- webpack(
- webpackCfgBuilder(config.paths.staticJS, !config.community, 'production'),
- webpackCallback(done)
- );
+ webpack(webpackCfgBuilder(config.paths.staticJS, !config.community, 'production'), webpackCallback(done));
};
diff --git a/tests/MailSo/Base/HtmlUtilsTest.php b/tests/MailSo/Base/HtmlUtilsTest.php
deleted file mode 100644
index e927002bb1..0000000000
--- a/tests/MailSo/Base/HtmlUtilsTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-assertTrue(true);
- $this->assertTrue(class_exists('\\RainLoop\\Api'));
- $this->assertTrue(class_exists('\\MailSo\\Base\\HtmlUtils'));
- }
-
- public function testClearHtml()
- {
- $i = 0;
- while (++$i < 3)
- {
- $this->assertEquals(file_get_contents(TEST_DATA_FOLDER."/html/{$i}-ok.html"),
- \MailSo\Base\HtmlUtils::ClearHtmlSimple(file_get_contents(TEST_DATA_FOLDER."/html/{$i}.html"), false, false, false));
- }
- }
-}
diff --git a/tests/MailSo/Base/LinkFinderTest.php b/tests/MailSo/Base/LinkFinderTest.php
deleted file mode 100644
index b172678600..0000000000
--- a/tests/MailSo/Base/LinkFinderTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-object = \MailSo\Base\LinkFinder::NewInstance();
- }
-
- protected function tearDown()
- {
- $this->object = null;
- }
-
- public function testNewInstance()
- {
- $this->assertTrue($this->object instanceof \MailSo\Base\LinkFinder);
- }
-
- public function testClear()
- {
- $this->object->Text('111');
- $this->assertEquals('111', $this->object->CompileText());
- $this->object->Clear();
- $this->assertEquals('', $this->object->CompileText());
- }
-
- public function testText()
- {
- $this->object->Text('222');
- $this->assertEquals('222', $this->object->CompileText());
- }
-
- public function testLinkWrapper()
- {
- $this->object
- ->Text('333 http://domain.com 333')
- ->LinkWrapper(function ($sLink) {
- return '!'.$sLink.'!';
- })
- ;
-
- $this->assertEquals('333 !http://domain.com! 333', $this->object->CompileText());
- }
-
- public function testMailWrapper()
- {
- $this->object
- ->Text('444 user@domain.com 444')
- ->MailWrapper(function ($sMail) {
- return '!'.$sMail.'!';
- })
- ;
-
- $this->assertEquals('444 !user@domain.com! 444', $this->object->CompileText());
- }
-
- public function testUseDefaultWrappers()
- {
- $this->object
- ->Text('555 http://domain.com user@domain.com 555')
- ->UseDefaultWrappers()
- ;
-
- $this->assertEquals('555
http://domain.com user@domain.com 555',
- $this->object->CompileText());
-
- $this->object->UseDefaultWrappers(true);
-
- $this->assertEquals('555
http://domain.com user@domain.com 555',
- $this->object->CompileText());
- }
-
- public function testCompileText()
- {
- $this->object
- ->Text('777 http://domain.com domain.com user@domain.com <> 777')
- ->LinkWrapper(function ($sLink) {
- return '~'.$sLink.'~';
- })
- ->MailWrapper(function ($sMail) {
- return '~'.$sMail.'~';
- })
- ;
-
- $this->assertEquals('777 ~http://domain.com~ domain.com ~user@domain.com~ <> 777', $this->object->CompileText(true));
- $this->assertEquals('777 ~http://domain.com~ domain.com ~user@domain.com~ <> 777', $this->object->CompileText(false));
- }
-}
diff --git a/tests/MailSo/Imap/ImapClientTest.php b/tests/MailSo/Imap/ImapClientTest.php
deleted file mode 100644
index 92d994029a..0000000000
--- a/tests/MailSo/Imap/ImapClientTest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-TestSetValues($rConnect, array('NAMESPACE'));
- $oResult = $oImapClient->GetNamespace();
-
- $this->assertTrue($oResult instanceof \MailSo\Imap\NamespaceResult);
- }
-
- public function testQuota()
- {
- $rConnect = \MailSo\Base\StreamWrappers\Test::CreateStream(
- '* QUOTAROOT "INBOX" ""'.self::CRLF.
- '* QUOTA "" (STORAGE 55163 10511217)'.self::CRLF.
- 'TAG1 OK Success'.self::CRLF
- );
-
- $oImapClient = \MailSo\Imap\ImapClient::NewInstance()->TestSetValues($rConnect, array('QUOTA'));
-
- $aResult = $oImapClient->Quota();
- $this->assertTrue(is_array($aResult));
- $this->assertEquals(4, count($aResult));
- $this->assertEquals(55163, $aResult[0]);
- $this->assertEquals(10511217, $aResult[1]);
- }
-
- public function testFolderList()
- {
- $rConnect = \MailSo\Base\StreamWrappers\Test::CreateStream(
-'* LIST (\Noselect) "/" 0'.self::CRLF.
-'* LIST (\UnMarked) "/" 0/1'.self::CRLF.
-'* LIST (\Noselect) "/" 1'.self::CRLF.
-'* LIST (\Noselect) "/" 1/2'.self::CRLF.
-'* LIST (\UnMarked) "/" 1/2/3'.self::CRLF.
-'* LIST (\UnMarked \Inbox) "/" INBOX'.self::CRLF.
-'* LIST (\UnMarked) "/" "INBOX/XXX XXX"'.self::CRLF.
-'* LIST (\UnMarked) "/" &-BT,MAQBDoEM'.self::CRLF.
-'* LIST (\UnMarked) "NIL" NILDelimiteFolder'.self::CRLF.
-'* LIST (\UnMarked) "" EmptyDelimiteFolder'.self::CRLF.
-'TAG1 OK Success'.self::CRLF
- );
-
- $oImapClient = \MailSo\Imap\ImapClient::NewInstance()->TestSetValues($rConnect);
-
- $aResult = $oImapClient->FolderList();
- $this->assertTrue(is_array($aResult) && 0 < count($aResult));
- $this->assertTrue($aResult[0] instanceof \MailSo\Imap\Folder);
-
- $this->assertEquals('0', $aResult[0]->FullNameRaw());
- $this->assertEquals('0', $aResult[0]->NameRaw());
- $this->assertEquals('0/1', $aResult[1]->FullNameRaw());
- $this->assertEquals('1', $aResult[1]->NameRaw());
- $this->assertEquals('1', $aResult[2]->FullNameRaw());
- $this->assertEquals('1/2', $aResult[3]->FullNameRaw());
- $this->assertEquals('1/2/3', $aResult[4]->FullNameRaw());
- $this->assertEquals('3', $aResult[4]->NameRaw());
- $this->assertEquals('INBOX', $aResult[5]->FullNameRaw());
- $this->assertEquals('INBOX/XXX XXX', $aResult[6]->FullNameRaw());
- $this->assertEquals('XXX XXX', $aResult[6]->NameRaw());
- $this->assertEquals('&-BT,MAQBDoEM', $aResult[7]->FullNameRaw());
-
- $this->assertTrue($aResult[5] instanceof \MailSo\Imap\Folder);
- $this->assertEquals('/', $aResult[5]->Delimiter());
- $this->assertEquals(2, count($aResult[5]->FlagsLowerCase()));
- $this->assertTrue(in_array('\inbox', $aResult[5]->FlagsLowerCase()));
-
- $this->assertTrue($aResult[8] instanceof \MailSo\Imap\Folder);
- $this->assertEquals('.', $aResult[8]->Delimiter());
-
- $this->assertTrue($aResult[9] instanceof \MailSo\Imap\Folder);
- $this->assertEquals('.', $aResult[8]->Delimiter());
- }
-}
diff --git a/tests/MailSo/Mime/EmailCollectionTest.php b/tests/MailSo/Mime/EmailCollectionTest.php
deleted file mode 100644
index 382a163815..0000000000
--- a/tests/MailSo/Mime/EmailCollectionTest.php
+++ /dev/null
@@ -1,18 +0,0 @@
-assertEquals(1, $oMails->Count());
- }
-
- public function testNewInstance1()
- {
- $oMails = \MailSo\Mime\EmailCollection::NewInstance('User Name
, User D\'Name , "User Name" ');
- $this->assertEquals(3, $oMails->Count());
- }
-}
diff --git a/tests/MailSo/Mime/EmailTest.php b/tests/MailSo/Mime/EmailTest.php
deleted file mode 100644
index 5fe921de1a..0000000000
--- a/tests/MailSo/Mime/EmailTest.php
+++ /dev/null
@@ -1,127 +0,0 @@
-assertEquals('admin@example.com', $oMail->GetEmail());
- $this->assertEquals('Administrator', $oMail->GetDisplayName());
- $this->assertEquals('admin', $oMail->GetAccountName());
- $this->assertEquals('example.com', $oMail->GetDomain());
- $this->assertEquals('"Administrator" ', $oMail->ToString());
- $this->assertEquals(array('Administrator', 'admin@example.com', 'none', ''), $oMail->ToArray());
- }
-
- public function testNewInstance1()
- {
- $oMail = \MailSo\Mime\Email::NewInstance('admin@example.com');
- $this->assertEquals('admin@example.com', $oMail->GetEmail());
- $this->assertEquals('', $oMail->GetDisplayName());
- $this->assertEquals('admin@example.com', $oMail->ToString());
- $this->assertEquals(array('', 'admin@example.com', 'none', ''), $oMail->ToArray());
- }
-
- public function testNewInstance2()
- {
- $oMail = \MailSo\Mime\Email::NewInstance('admin@example.com', 'Administrator');
- $this->assertEquals('admin@example.com', $oMail->GetEmail());
- $this->assertEquals('Administrator', $oMail->GetDisplayName());
- $this->assertEquals('"Administrator" ', $oMail->ToString());
- $this->assertEquals(array('Administrator', 'admin@example.com', 'none', ''), $oMail->ToArray());
- }
-
- public function testNewInstance3()
- {
- $oMail = \MailSo\Mime\Email::NewInstance('admin@example.com', '');
- $this->assertEquals('admin@example.com', $oMail->GetEmail());
- $this->assertEquals('', $oMail->GetDisplayName());
- $this->assertEquals('admin@example.com', $oMail->ToString());
- $this->assertEquals(array('', 'admin@example.com', 'none', ''), $oMail->ToArray());
- }
-
- /**
- * @expectedException \MailSo\Base\Exceptions\InvalidArgumentException
- */
- public function testNewInstance4()
- {
- $oMail = \MailSo\Mime\Email::NewInstance('');
- }
-
- public function testParse1()
- {
- $oMail = \MailSo\Mime\Email::Parse('help@example.com');
- $this->assertEquals('help@example.com', $oMail->GetEmail());
-
- $oMail = \MailSo\Mime\Email::Parse('');
- $this->assertEquals('help@example.com', $oMail->GetEmail());
- }
-
- public function testParse2()
- {
- $oMail = \MailSo\Mime\Email::Parse('"Тест" ');
- $this->assertEquals('"Тест" ', $oMail->ToString());
- }
-
- public static function providerForParse()
- {
- return array(
- array('test ',
- array('test', 'help@example.com')),
- array('test',
- array('test', 'help@example.com')),
- array('test< help@example.com >',
- array('test', 'help@example.com')),
- array('"New \" Admin" ',
- array('New " Admin', 'help@example.com')),
- array('"Тест" ',
- array('Тест', 'help@example.com')),
- array('Microsoft Outlook',
- array('Microsoft Outlook', 'MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@ppth.private')),
- );
- }
-
- public static function providerForParse2()
- {
- return array(
- array('help@xn--d1abbgf6aiiy.xn--p1ai',
- array('', 'help@президент.рф')),
- );
- }
-
- /**
- * @dataProvider providerForParse
- */
- public function testParseWithProvider($sValue, $aResult)
- {
- $oMail = \MailSo\Mime\Email::Parse($sValue);
- $this->assertEquals($aResult, $oMail->ToArray(false, false));
- }
-
- /**
- * @dataProvider providerForParse2
- */
- public function testParseWithProvider2($sValue, $aResult)
- {
- $oMail = \MailSo\Mime\Email::Parse($sValue);
- $this->assertEquals($aResult, $oMail->ToArray(true, false));
- }
-
- /**
- * @expectedException \MailSo\Base\Exceptions\InvalidArgumentException
- */
- public function testParse5()
- {
- \MailSo\Mime\Email::Parse('');
- }
-
- /**
- * @expectedException \MailSo\Base\Exceptions\InvalidArgumentException
- */
- public function testParse6()
- {
- \MailSo\Mime\Email::Parse('example.com');
- }
-}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
deleted file mode 100644
index d5667e602e..0000000000
--- a/tests/bootstrap.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-123
-
-