Skip to content

Commit

Permalink
Merge pull request Lakion#1 from Arminek/remove-ui-related-stuff
Browse files Browse the repository at this point in the history
[ElasticSearch] Rename & remove ui & bump dsl to 5.0
  • Loading branch information
lchrusciel authored May 30, 2017
2 parents cdd4d12 + 0f83a8b commit 7e514f1
Show file tree
Hide file tree
Showing 142 changed files with 2,024 additions and 2,841 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ language: php

php:
- 7.1
- 7.0
- 5.6

jdk:
- oraclejdk8

addons:
apt:
sources:
- elasticsearch-2.x
- elasticsearch-5.x
packages:
- elasticsearch
- oracle-java8-set-default

services:
- elasticsearch
Expand All @@ -29,7 +31,7 @@ before_install:
install:
- composer update --prefer-dist
- tests/Application/bin/console doctrine:schema:create --env=test -vvv --no-interaction
- tests/Application/bin/console fos:elastica:reset --env=test -vvv --no-interaction
- tests/Application/bin/console ongr:es:index:create -vvv --no-interaction

script:
- bin/phpspec run --no-interaction
Expand Down
35 changes: 7 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sylius ElasticSearchBundle
Sylius ElasticSearchPlugin
==========================
Elastic search for Sylius.
[![Build status on Linux](https://img.shields.io/travis/Lakion/SyliusElasticSearchBundle/master.svg)](http://travis-ci.org/Lakion/SyliusELasticSearchBundle)
Expand All @@ -8,12 +8,12 @@ Elastic search for Sylius.
1. Install it:

```bash
$ composer require lakion/sylius-elastic-search-bundle
$ composer require sylius/elastic-search-plugin
```
2. Install elastic search server:

```bash
$ brew install elasticsearch@2.4
$ brew install elasticsearch@5.0
```

3. Run elastic search server:
Expand All @@ -25,8 +25,8 @@ Elastic search for Sylius.
4. Add this bundle to `AppKernel.php`:

```php
new \FOS\ElasticaBundle\FOSElasticaBundle(),
new \Lakion\SyliusElasticSearchBundle\LakionSyliusElasticSearchBundle(),
new \ONGR\ElasticsearchBundle\ONGRElasticsearchBundle(),
new \Lakion\SyliusElasticSearchBundle\SyliusElasticSearchPlugin(),
```

5. Create/Setup database:
Expand All @@ -37,37 +37,16 @@ Elastic search for Sylius.
$ app/console syl:fix:lo
```

6. Populate your elastic search server with command or your custom code:

```bash
$ app/console fos:elastic:pop
```

7. Import config file in `app/config/config.yml` for default filter set configuration:

```yaml
imports:
- { resource: "@LakionSyliusElasticSearchBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusElasticSearchPlugin/Resources/config/app/config.yml" }
```
8. Import routing files in `app/config/routing.yml`:
```yaml
sylius_search:
resource: "@LakionSyliusElasticSearchBundle/Resources/config/routing.yml"
```
8. Configuration reference:
```yaml
lakion_sylius_elastic_search:
filter_sets:
mugs:
filters:
product_options:
type: option
options:
code: mug_type
product_price:
type: price
resource: "@SyliusElasticSearchPlugin/Resources/config/routing.yml"
```
21 changes: 11 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "lakion/sylius-elastic-search-bundle",
"name": "sylius/elastic-search-plugin",
"type": "sylius-bundle",
"description": "Elastic search integration for Sylius.",
"license": "MIT",
"authors": [
{
"name": "Arkadiusz Krakowiak",
"email": "arkadiusz.krakowiak@lakion.com",
"homepage": "http://lakion.com"
"email": "arkadiusz.k.e@gmail.com",
"homepage": "http://github.com/arminek"
}
],
"require": {
"php": "^5.6|^7.0",

"sylius/sylius": "dev-master",

"friendsofsymfony/elastica-bundle": "^4.0",
"ongr/elasticsearch-dsl": "^2.0"
"ongr/elasticsearch-dsl": "^5.0",
"ongr/elasticsearch-bundle": "^5.0",
"simple-bus/symfony-bridge": "^4.1",
"beberlei/porpaginas": "^1.0"
},
"require-dev": {
"behat/behat": "^3.2",
"behat/mink": "^1.7",
"behat/mink-browserkit-driver": "^1.3",
"behat/mink-extension": "^2.2",
"behat/mink-selenium2-driver": "^1.3",
"friends-of-behat/context-service-extension": "^0.3",
"friends-of-behat/cross-container-extension": "^0.2",
"friends-of-behat/performance-extension": "^1.0",
Expand All @@ -35,7 +35,8 @@
"matthiasnoback/symfony-dependency-injection-test": "^1.1",
"php-http/guzzle6-adapter": "^1.1",
"phpspec/phpspec": "^3.2",
"phpunit/phpunit": "^5.6"
"phpunit/phpunit": "^5.6",
"behat/mink-selenium2-driver": "^1.3"
},
"config": {
"bin-dir": "bin"
Expand All @@ -44,8 +45,8 @@
"prefer-stable": true,
"autoload": {
"psr-4": {
"Lakion\\SyliusElasticSearchBundle\\": "src/",
"Tests\\Lakion\\SyliusElasticSearchBundle\\": "tests/"
"Sylius\\ElasticSearchPlugin\\": "src/",
"Tests\\Sylius\\ElasticSearchPlugin\\": "tests/"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ Feature: Filtering list of products by channels
I want to be able to filter the products

Background:
Given the store operates on a channel named "Europe"
And the store also operates on another channel named "Mobile"
And the store also operates on another channel named "Tablets"
And the store has a product "Banana T-Shirt" priced at "$100" in "Tablets" channel
And the store also has a product "Star Wars T-Shirt" priced at "$150" in "Mobile" channel
And the store also has a product "LOTR T-Shirt" priced at "$300" in "Mobile" channel
And the store also has a product "Breaking Bad T-Shirt" priced at "$50" in "Mobile" channel
And the store also has a product "Westworld T-Shirt" priced at "$1000" in "Europe" channel
And the store also has a product "Orange T-Shirt" priced at "$1000" in "Europe" channel
Given the store has a product "Banana T-Shirt" priced at "$100" in "tablets" channel
And the store also has a product "Star Wars T-Shirt" priced at "$150" in "mobile" channel
And the store also has a product "LOTR T-Shirt" priced at "$300" in "mobile" channel
And the store also has a product "Breaking Bad T-Shirt" priced at "$50" in "mobile" channel
And the store also has a product "Westworld T-Shirt" priced at "$1000" in "europe" channel
And the store also has a product "Orange T-Shirt" priced at "$1000" in "europe" channel

@domain
Scenario: Filtering products by mobile channel
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ Feature: Filtering list of products by price range
I want to be able to filter the products

Background:
Given the store operates on a single channel in "United States"
And the store has a product "Banana T-Shirt" priced at "$100"
Given the store has a product "Banana T-Shirt" priced at "$100"
And the store also has a product "Star Wars T-Shirt" priced at "$150"
And the store also has a product "LOTR T-Shirt" priced at "$300"
And the store also has a product "Breaking Bad T-Shirt" priced at "$50"

@domain @ui
@domain
Scenario: Filtering products by price range
When I filter them by price between "$100" and "$200"
Then I should see 2 products on the list
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ Feature: Filtering list of products by channels and price
I want to be able to filter the products

Background:
Given the store operates on a channel named "Europe"
And the store also operates on another channel named "Mobile"
And the store also operates on another channel named "Tablets"
And the store has a product "Banana T-Shirt" priced at "$100" in "Tablets" channel
And the store also has a product "Star Wars T-Shirt" priced at "$150" in "Mobile" channel
And the store also has a product "LOTR T-Shirt" priced at "$300" in "Mobile" channel
And the store also has a product "Breaking Bad T-Shirt" priced at "$50" in "Mobile" channel
And the store also has a product "Westworld T-Shirt" priced at "$1000" in "Europe" channel
And the store also has a product "Orange T-Shirt" priced at "$1000" in "Europe" channel
Given the store has a product "Banana T-Shirt" priced at "$100" in "tablets" channel
And the store also has a product "Star Wars T-Shirt" priced at "$150" in "mobile" channel
And the store also has a product "LOTR T-Shirt" priced at "$300" in "mobile" channel
And the store also has a product "Breaking Bad T-Shirt" priced at "$50" in "mobile" channel
And the store also has a product "Westworld T-Shirt" priced at "$1000" in "europe" channel
And the store also has a product "Orange T-Shirt" priced at "$1000" in "europe" channel

@domain
Scenario: Filtering products by mobile channel and price range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@ Feature: Filtering list of products by taxon
I want to be able to filter the products

Background:
Given the store classifies its products as Mugs, Stickers and Books
And the store has 40 Mugs, 15 Stickers and 50 Books
Given the store has 3 Mugs, 2 Stickers and 5 Books

@domain
Scenario: Filtering products by book
When I filter them by "Books" taxon
Then I should see 50 products on the list
When I filter them by "books" taxon
Then I should see 5 products on the list

@domain
Scenario: Filtering product by stickers
When I filter them by "Stickers" taxon
Then I should see 15 products on the list
When I filter them by "stickers" taxon
Then I should see 2 products on the list

@domain
Scenario: Filtering product by mugs
When I filter them by "Mugs" taxon
Then I should see 40 products on the list
When I filter them by "mugs" taxon
Then I should see 3 products on the list

@domain
Scenario: List of all products without filtering
When I view the list of the products without filtering
Then I should see 105 products on the list
Then I should see 10 products on the list
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Feature: Searching products by name
I want to be able to filter the products

Background:
Given the store operates on a channel named "Europe"
And the store has a product "Banana T-Shirt"
Given the store has a product "Banana T-Shirt"
And the store has a product "Star Wars T-Shirt"
And the store has a product "Star Wars Rogue T-Shirt"
And the store has a product "Breaking Bad Saul T-Shirt"
Expand All @@ -17,37 +16,37 @@ Feature: Searching products by name
And the store has a product "Westworld Hosts T-Shirt"
And the store has a product "Westworld Hopkins T-Shirt"

@domain @ui
@domain
Scenario: Searching products by name
When I search for products with name "Banana"
Then I should see 1 products on the list
And It should be "Banana T-Shirt"

@domain @ui
@domain
Scenario: Searching products by name
When I search for products with name "Star"
Then I should see 2 products on the list
And It should be "Star Wars T-Shirt", "Star Wars Rogue T-Shirt"

@domain @ui
@domain
Scenario: Searching products by name
When I search for products with name "Bad"
Then I should see 4 products on the list
And It should be "Breaking Bad Saul T-Shirt", "Breaking Bad Mike T-Shirt", "Breaking Bad Jesse T-Shirt", "Breaking Bad Heisenberg T-Shirt"

@domain @ui
@domain
Scenario: Searching products by name
When I search for products with name "Westworld"
Then I should see 3 products on the list
And It should be "Westworld T-Shirt", "Westworld Hosts T-Shirt", "Westworld Hopkins T-Shirt"

@domain @ui
@domain
Scenario: Searching products by name
When I search for products with name "Hopkins"
Then I should see 1 products on the list
And It should be "Westworld Hopkins T-Shirt"

@domain @ui
@domain
Scenario: Searching products by name
When I search for products with name "T-Shirt"
Then I should see 10 products on the list
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ Feature: Sorting list of products by name
I want to be able to sort the products

Background:
Given the store operates on a channel named "Europe"
And the store also operates on another channel named "Mobile"
And the store also operates on another channel named "Tablets"
And the store has a product "Banana T-Shirt" priced at "$100" in "Tablets" channel
And the store also has a product "Star Wars T-Shirt" priced at "$150" in "Mobile" channel
And the store also has a product "LOTR T-Shirt" priced at "$300" in "Mobile" channel
And the store also has a product "Breaking Bad T-Shirt" priced at "$50" in "Mobile" channel
And the store also has a product "Westworld T-Shirt" priced at "$1000" in "Europe" channel
And the store also has a product "Orange T-Shirt" priced at "$1000" in "Europe" channel
Given the store has a product "Banana T-Shirt" priced at "$100" in "tablets" channel
And the store also has a product "Star Wars T-Shirt" priced at "$150" in "mobile" channel
And the store also has a product "LOTR T-Shirt" priced at "$300" in "mobile" channel
And the store also has a product "Breaking Bad T-Shirt" priced at "$50" in "mobile" channel
And the store also has a product "Westworld T-Shirt" priced at "$1000" in "europe" channel
And the store also has a product "Orange T-Shirt" priced at "$1000" in "europe" channel

@domain
Scenario: Sorting products by name in ascending order
Expand Down
4 changes: 2 additions & 2 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
suites:
default:
namespace: Lakion\SyliusElasticSearchBundle
psr4_prefix: Lakion\SyliusElasticSearchBundle
namespace: Sylius\ElasticSearchPlugin
psr4_prefix: Sylius\ElasticSearchPlugin
29 changes: 29 additions & 0 deletions spec/Document/AttributeSpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace spec\Sylius\ElasticSearchPlugin\Document;

use ONGR\ElasticsearchBundle\Collection\Collection;
use Sylius\ElasticSearchPlugin\Document\Attribute;
use PhpSpec\ObjectBehavior;

final class AttributeSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Attribute::class);
}

function it_has_code()
{
$this->setCode('color');

$this->getCode()->shouldReturn('color');
}

function it_has_name()
{
$this->setName('color');

$this->getName()->shouldReturn('color');
}
}
Loading

0 comments on commit 7e514f1

Please sign in to comment.