diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a187881491dd64936221266e464d4c09fc800895
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,213 @@
+before_script:
+  - cd ${CI_PROJECT_DIR}
+
+variables:
+  MYSQL_ROOT_PASSWORD: mysql
+  MYSQL_DATABASE: wptest
+  MYSQL_USER: mysql
+  MYSQL_PASSWORD: mysql
+  MYSQL_INNODB_LOG_BUFFER_SIZE: 32M
+  PHP_ERROR_REPORTING: E_ALL
+  COMPOSER_ALLOW_SUPERUSER: 1
+  GIT_STRATEGY: fetch
+
+cache:
+  untracked: true
+  paths:
+    - vendor
+
+stages:
+  - build
+  - tests
+  - pre-deploy
+  - deploy
+
+build php:
+  image: wpdesknet/phpunit-woocommerce:0-0
+  stage: build
+  artifacts:
+    expire_in: 1 day
+    name: "dev vendor"
+    paths:
+      - vendor/
+  script:
+    - ls /usr/local/bin
+    - composer install --no-progress
+
+#build js:
+#  image: node:slim
+#  stage: build
+#  script:
+#    - cd app
+#    - git clone git@gitlab.com:wpdesk/plugins-tests.git
+#    - cd plugins-tests
+#    - npm install
+#    - grunt dev-chrome
+
+code style test:
+  image: wpdesknet/phpunit-woocommerce:0-0
+  stage: tests
+  allow_failure: true
+  dependencies:
+    - build php
+  script:
+    - ls -l
+    - php --version
+    - php composer.phar phpcs
+
+unit test 0:
+  image: wpdesknet/phpunit-woocommerce:0-0
+  stage: tests
+  dependencies:
+    - build php
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+  script:
+    - ls -l
+    - php --version
+    - php composer.phar phpunit-unit
+
+integration test 0-0:
+  image: wpdesknet/phpunit-woocommerce:0-0
+  services:
+    - mysql
+  stage: tests
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+  dependencies:
+    - build php
+  script:
+    - php --version
+    - php composer.phar phpunit-integration
+
+integration test 1-1:
+  image: wpdesknet/phpunit-woocommerce:1-1
+  services:
+    - mysql
+  stage: tests
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+  dependencies:
+    - build php
+  script:
+    - php --version
+    - php composer.phar phpunit-integration
+
+integration test 2-2:
+  image: wpdesknet/phpunit-woocommerce:2-2
+  services:
+    - mysql
+  stage: tests
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+  dependencies:
+    - build php
+  script:
+    - php --version
+    - php composer.phar phpunit-integration
+
+integration test 3-3:
+  image: wpdesknet/phpunit-woocommerce:3-3
+  services:
+    - mysql
+  stage: tests
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+  dependencies:
+    - build php
+  script:
+    - php --version
+    - phpunit --configuration phpunit-integration.xml
+
+integration test 4-3:
+  image: wpdesknet/phpunit-woocommerce:4-3
+  services:
+    - mysql
+  stage: tests
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+  dependencies:
+    - build php
+  script:
+    - php --version
+    - phpunit --configuration phpunit-integration.xml
+
+apigen docs:
+  image:
+    name: wpdesknet/apigen
+  stage: build
+  artifacts:
+    expire_in: 1 day
+    name: "docs"
+    paths:
+      - docs/
+  script:
+    - ls -l
+    - /app/vendor/bin/apigen generate
+    - php /app/hooks-docs.php ${CI_PROJECT_DIR}
+  when: manual
+
+build to deploy:
+  image: wpdesknet/phpunit-woocommerce:0-0
+  stage: pre-deploy
+  dependencies:
+    - build php
+  artifacts:
+    expire_in: 1 month
+    name: "production release"
+    paths:
+      - release
+      - release.zip
+  script:
+    - php --version
+    - ls -l
+    - rm -rf ${CI_PROJECT_DIR}/release
+    - rm -rf ${CI_PROJECT_DIR}/release.zip
+    - rm -rf /tmp/release
+    - mkdir /tmp/release
+    - mkdir ${CI_PROJECT_DIR}/release
+    - cp -rf ${CI_PROJECT_DIR}/* /tmp/release
+    - cp -rf /tmp/release/* ${CI_PROJECT_DIR}/release
+    - cd ${CI_PROJECT_DIR}/release
+    - php composer.phar install --no-dev --no-progress
+    - rm -rf build-coverage
+    - rm -rf release
+    - rm -rf tests
+    - rm -rf docs
+    - rm -rf .git
+    - rm -f .editorconfig
+    - rm -f .gitignore
+    - rm -f .gitlab-ci.yml
+    - rm -f apigen.neon
+    - rm -f composer.json
+    - rm -f composer.lock
+    - rm -f phpcs.xml.dist
+    - rm -f phpunit-integration.xml
+    - rm -f phpunit-unit.xml
+    - rm -f composer.phar
+    - rm -f wp-cli.phar
+    - zip -r -q ../release.zip ./
+  only:
+    - tags
+
+deploy to shop:
+  image: wpdesknet/amazon-svn-deploy
+  stage: deploy
+  dependencies:
+    - build to deploy
+  retry: 2
+  script:
+    - ls -l
+    - /tmp/deploy_shop.sh ${CI_PROJECT_NAME} release.zip ${CI_PROJECT_NAME}.zip
+  only:
+    - tags
+  when: manual
+
+deploy to repository:
+  image: wpdesknet/amazon-svn-deploy
+  stage: deploy
+  dependencies:
+    - build to deploy
+  retry: 2
+  script:
+    - ls -l
+    - rm -rf /tmp/svn-repository
+    - mkdir /tmp/svn-repository
+    - /tmp/deploy_repository.sh flexible-pdf release /tmp/svn-repository
+  only:
+    - tags
+  when: manual
\ No newline at end of file
diff --git a/apigen.neon b/apigen.neon
new file mode 100644
index 0000000000000000000000000000000000000000..1ba34455641292282d83787e91298a62735a7090
--- /dev/null
+++ b/apigen.neon
@@ -0,0 +1,28 @@
+destination: docs
+extensions: [php]
+source:
+    - classes
+    - plugin-template.php
+    - bootstrap.php
+exclude:
+    - vendor
+    - tests
+    - languages
+
+charset: [UTF-8]
+main: Wordpress plugin
+title: Plugin template more info
+baseUrl: "/"
+
+templateTheme: default
+php: false
+sourceCode: false
+tree: true
+deprecated: false
+todo: false
+download: false
+
+accessLevels:       
+    - public
+    - private
+    - protected
\ No newline at end of file
diff --git a/changelog.txt b/changelog.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5cdd438077949171275261635ff8a1447e40d109
--- /dev/null
+++ b/changelog.txt
@@ -0,0 +1,4 @@
+*** plugin-template Changelog ***
+
+1.0.0 - 2018-03-16
+* TEST
\ No newline at end of file
diff --git a/composer.json b/composer.json
index df5efb66f688785a0ac618900f94d285aabcdaf4..644bbe75bc9a5361c76f3a9393492266d1f8fdee 100644
--- a/composer.json
+++ b/composer.json
@@ -23,6 +23,10 @@
         }
     },
     "scripts": {
-        "phpcs": "vendor/bin/phpcs"
+        "test": "echo composer is alive",
+        "phpcs": "phpcs",
+        "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
+        "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
+	    "docs": "apigen generate"
     }
 }
diff --git a/composer.lock b/composer.lock
index 3f352436de5bdedd66628654326df6811cb9c6fd..ba3b5954bae0b75cac9139a79183d664f537aeac 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "be2486cd1b6bdbc457d614783adfc639",
+    "hash": "ab79cfb4a1a3de35a971fb4fedc9b4a5",
     "content-hash": "12219163e8f6b69c0711dc250b74948b",
     "packages": [],
     "packages-dev": [
diff --git a/phpunit-integration.xml b/phpunit-integration.xml
new file mode 100644
index 0000000000000000000000000000000000000000..fe31963657aea8edd36027ef763699d54b7fa941
--- /dev/null
+++ b/phpunit-integration.xml
@@ -0,0 +1,27 @@
+<phpunit bootstrap="tests/integration/bootstrap.php"
+         backupGlobals="false"
+     >
+    <testsuites>
+        <testsuite>
+            <directory prefix="test-" suffix=".php">./tests/integration</directory>
+        </testsuite>
+    </testsuites>
+
+    <filter>
+        <whitelist>
+            <directory suffix=".php">classes</directory>
+        </whitelist>
+    </filter>
+
+    <logging>
+        <log type="junit" target="build-coverage/report.junit.xml"/>
+        <log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
+        <log type="coverage-text" target="build-coverage/coverage.txt"/>
+        <log type="coverage-clover" target="build-coverage/clover.xml"/>
+    </logging>
+    <php>
+        <env name="WP_DEVELOP_DIR" value="/tmp/wordpress-develop"/>
+        <env name="WC_DEVELOP_DIR" value="/tmp/woocommerce"/>
+    </php>
+
+</phpunit>
\ No newline at end of file
diff --git a/phpunit-unit.xml b/phpunit-unit.xml
new file mode 100644
index 0000000000000000000000000000000000000000..627771b41d48361153c75eb0d810a063e6d6680f
--- /dev/null
+++ b/phpunit-unit.xml
@@ -0,0 +1,21 @@
+<phpunit bootstrap="tests/unit/bootstrap.php">
+    <testsuites>
+        <testsuite>
+            <directory prefix="test-" suffix=".php">./tests/unit/</directory>
+        </testsuite>
+    </testsuites>
+
+    <filter>
+        <whitelist>
+            <directory suffix=".php">classes</directory>
+        </whitelist>
+    </filter>
+
+    <logging>
+        <log type="junit" target="build-coverage/report.junit.xml"/>
+        <log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
+        <log type="coverage-text" target="build-coverage/coverage.txt"/>
+        <log type="coverage-clover" target="build-coverage/clover.xml"/>
+    </logging>
+
+</phpunit>
\ No newline at end of file
diff --git a/plugin-template.php b/plugin-template.php
index 74f2d555eb22ad4b0706984b8d2361730bf989aa..89d060fa7fa052e40b9d1013fe9b3d4b3ef6885b 100644
--- a/plugin-template.php
+++ b/plugin-template.php
@@ -28,6 +28,7 @@
 
 */
 
+
 if ( ! defined( 'ABSPATH' ) ) {
 	exit;
 } // Exit if accessed directly
diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php
new file mode 100644
index 0000000000000000000000000000000000000000..96999134d674cec031233ebf31a030b44d7d7d0d
--- /dev/null
+++ b/tests/integration/bootstrap.php
@@ -0,0 +1,22 @@
+<?php
+// disable xdebug backtrace
+if ( function_exists( 'xdebug_disable' ) ) {
+	xdebug_disable();
+}
+
+if ( getenv( 'PLUGIN_PATH' ) !== false ) {
+	define( 'PLUGIN_PATH', getenv( 'PLUGIN_PATH' ) );
+} else {
+	define( 'PLUGIN_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR );
+}
+
+require_once( getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/functions.php' );
+
+tests_add_filter( 'muplugins_loaded', function () {
+	require PLUGIN_PATH . '/plugin-template.php';
+	$plugins_to_active[] = 'plugin-template/plugin-template.php';
+	update_option( 'active_plugins', $plugins_to_active );
+}, 100 );
+
+putenv('WP_TESTS_DIR=' . getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit');
+require_once( getenv( 'WC_DEVELOP_DIR' ) . '/tests/bootstrap.php' );
diff --git a/tests/integration/wpdesk/test-plugin-template-factory.php b/tests/integration/wpdesk/test-plugin-template-factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..07f63062676ae54e5237e2ef3a8f14d32b3a09c1
--- /dev/null
+++ b/tests/integration/wpdesk/test-plugin-template-factory.php
@@ -0,0 +1,23 @@
+<?php
+
+use PHPUnit\Framework\TestCase;
+
+require_once( PLUGIN_PATH . '/classes/wpdesk/class-plugin.php' );
+require_once( PLUGIN_PATH . '/classes/plugin-template-factory.php' );
+
+class Test_WPDesk_Plugin_Template_Factory extends TestCase {
+
+	public function testBuildForNotActivatedPlugin() {
+		$factory = new WPDesk_Plugin_Template_Factory();
+		$this->assertInstanceOf( WPDesk_Plugin_Template_Plugin::class, $factory::build_plugin() );
+	}
+
+	public function testGetPluginAlwaysSingleInstance() {
+		$factory = new WPDesk_Plugin_Template_Factory();
+		$instanceOne = $factory::get_plugin_instance();
+		$instanceTwo = $factory::get_plugin_instance();
+
+		$this->assertInstanceOf( WPDesk_Plugin_Template_Plugin::class, $instanceOne );
+		$this->assertSame($instanceOne, $instanceTwo);
+	}
+}
\ No newline at end of file
diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php
new file mode 100644
index 0000000000000000000000000000000000000000..e55059f69f9265d81aa3a4afa8c679633a5a6ad9
--- /dev/null
+++ b/tests/unit/bootstrap.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * PHPUnit bootstrap file
+ */
+
+require_once __DIR__ . '/../../vendor/autoload.php';
+
+error_reporting( E_ALL );
+
+if ( getenv( 'PLUGIN_PATH' ) !== false ) {
+	define( 'PLUGIN_PATH', getenv( 'PLUGIN_PATH' ) );
+} else {
+	define( 'PLUGIN_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR );
+}
+
+if ( getenv( 'ABSPATH' ) !== false ) {
+	define( 'ABSPATH', getenv( 'ABSPATH' ) );
+} else {
+	define( 'ABSPATH', PLUGIN_PATH . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR );
+}
+
+WP_Mock::setUsePatchwork( true );
+WP_Mock::bootstrap();
diff --git a/tests/unit/wpdesk/test-plugin-template-factory.php b/tests/unit/wpdesk/test-plugin-template-factory.php
new file mode 100644
index 0000000000000000000000000000000000000000..2ab9028104427d082d8cdcce74012577f78ca0dd
--- /dev/null
+++ b/tests/unit/wpdesk/test-plugin-template-factory.php
@@ -0,0 +1,38 @@
+<?php
+
+use PHPUnit\Framework\TestCase;
+
+require_once( PLUGIN_PATH . '/classes/wpdesk/class-plugin.php' );
+require_once( PLUGIN_PATH . '/classes/plugin-template-factory.php' );
+
+class Test_WPDesk_Plugin_Template_Factory extends TestCase {
+	public function setUp() {
+		WP_Mock::setUp();
+	}
+
+	public function tearDown() {
+		WP_Mock::tearDown();
+	}
+
+	public function testBuildForNotActivatedPlugin() {
+		WP_Mock::userFunction( 'plugin_basename', [
+			'return' => 'some-plugin-name'
+		] );
+		WP_Mock::userFunction( 'admin_url', [
+			'return' => 'http://whatever.com'
+		] );
+		WP_Mock::userFunction( 'get_option', [
+			'args' => [ 'api_._activated', '0' ],
+			'return' => 'not Activated'
+		] );
+		WP_Mock::userFunction( 'plugin_dir_url', [
+			'return' => 'whatever'
+		] );
+		WP_Mock::userFunction( 'trailingslashit', [
+			'return_arg' => 0
+		] );
+
+		$factory = new WPDesk_Plugin_Template_Factory();
+		$this->assertInstanceOf( WPDesk_Plugin_Template_Plugin::class, $factory::build_plugin() );
+	}
+}
\ No newline at end of file