Skip to content

Commit db270ff

Browse files
author
Antonio Mansilla
authored
Merge pull request #18 from flagbit/3.0
Add support for Akeneo 3.0
2 parents b7f6bf3 + a422b78 commit db270ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+618
-258
lines changed

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ cache:
1212
- $HOME/.composer/cache
1313

1414
matrix:
15-
include:
16-
- php: 7.1
17-
- php: 7.2
15+
fast_finish: true
16+
include:
17+
- php: 7.2
18+
- php: 7.3
19+
allow_failures:
20+
- php: 7.3
1821

1922
before_install:
20-
# disable default memory limit
21-
- export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
22-
- echo memory_limit = -1 >> $INI
23+
# disable default memory limit
24+
- export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
25+
- echo memory_limit = -1 >> $INI
2326

2427
install:
2528
- travis_retry composer install $COMPOSER_OPTS

CHANGELOG-3.0.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 3.0.0
2+
3+
- Add support for Akeneo 3.0.0.
4+
5+
## BC breaks
6+
7+
- `Flagbit\Bundle\TableAttributeBundle\Normalizer\StructuredAttributeOptionNormalizer` was deleted. `Flagbit\Bundle\TableAttributeBundle\Normalizer\AttributeOptionNormalizer` is now used for its service.

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Please note that this project is released with a [Contributor Code of Conduct](C
66

77
| Branch | Akeneo Compatibility |
88
| ------------- |:-------------:|
9-
| `master` | `>= 2.0.5 & < 3.0.0` |
9+
| `master` | `>= 3.0.0` |
10+
| `2.X` | `>= 2.0.5 & < 3.0.0` |
1011
| `2.0` | `>= 2.0.0 & < 2.0.5` |
1112
| `1.X` | `>= 1.6.0 & < 2.0.0` |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Add `mapping_overrides` in `app/config/config.yml`:
8080
akeneo_storage_utils:
8181
mapping_overrides:
8282
-
83-
original: Pim\Bundle\CatalogBundle\Entity\AttributeOption
83+
original: Akeneo\Pim\Structure\Component\Model\AttributeOption
8484
override: Flagbit\Bundle\TableAttributeBundle\Entity\AttributeOption
8585
```
8686
@@ -119,8 +119,8 @@ php bin/console --env=prod doctrine:migrations:migrate
119119

120120
This extension supports the latest Akeneo PIM CE/EE stable versions:
121121

122+
* 3.0 (LTS)
122123
* 2.3 (LTS)
123-
* 2.1 and 2.2 (STS)
124124

125125
## Development
126126

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
}
4242
],
4343
"require": {
44-
"akeneo/pim-community-dev": "^2.0.5"
44+
"ext-json": "*",
45+
"akeneo/pim-community-dev": "^3.0.0"
4546
},
4647
"require-dev": {
47-
"phpspec/phpspec": "^4.2",
48+
"phpspec/phpspec": "^5.1",
4849
"phpunit/phpunit": "^7.1",
4950
"squizlabs/php_codesniffer": "*",
50-
"overtrue/phplint": "*",
51-
"leanphp/phpspec-code-coverage": "^4.2"
51+
"overtrue/phplint": "*"
5252
}
5353
}

phpspec.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
<logging>
3232
<log type="coverage-clover" target="build/clover.xml"/>
33-
<log type="coverage-html" target="build/coverage-html" title="Flagbit TableAttributeBundle" lowUpperBound="30"
34-
highLowerBound="80" charset="UTF-8" highlight="true" yui="true"/>
33+
<log type="coverage-html" target="build/coverage-html" lowUpperBound="30" highLowerBound="80"/>
3534
<log type="junit" target="build/junit.xml"/>
3635
</logging>
3736
</phpunit>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace spec\Flagbit\Bundle\TableAttributeBundle\AttributeType;
4+
5+
use Flagbit\Bundle\TableAttributeBundle\AttributeType\TableType;
6+
use PhpSpec\ObjectBehavior;
7+
8+
class TableTypeSpec extends ObjectBehavior
9+
{
10+
public function let()
11+
{
12+
$this->beConstructedWith('text');
13+
}
14+
15+
public function it_is_initializable()
16+
{
17+
$this->shouldHaveType(TableType::class);
18+
}
19+
20+
public function it_returns_flagbit_catalog_table()
21+
{
22+
$this->getName()->shouldReturn('flagbit_catalog_table');
23+
}
24+
25+
public function it_returns_text_forbackend_type()
26+
{
27+
$this->getBackendType()->shouldReturn('text');
28+
}
29+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace spec\Flagbit\Bundle\TableAttributeBundle\DependencyInjection;
4+
5+
use Flagbit\Bundle\TableAttributeBundle\DependencyInjection\Configuration;
6+
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7+
use PhpSpec\ObjectBehavior;
8+
9+
class ConfigurationSpec extends ObjectBehavior
10+
{
11+
public function it_is_initializable()
12+
{
13+
$this->shouldHaveType(Configuration::class);
14+
}
15+
16+
public function it_returns_Treebuilder_object()
17+
{
18+
$this->getConfigTreeBuilder()->shouldBeAnInstanceOf(TreeBuilder::Class);
19+
}
20+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace spec\Flagbit\Bundle\TableAttributeBundle\Form;
4+
5+
use Flagbit\Bundle\TableAttributeBundle\Form\TableJsonTransformer;
6+
use PhpSpec\ObjectBehavior;
7+
8+
class TableJsonTransformerSpec extends ObjectBehavior
9+
{
10+
public function it_is_initializable()
11+
{
12+
$this->shouldHaveType(TableJsonTransformer::class);
13+
}
14+
15+
public function it_keeps_transform_value()
16+
{
17+
$originalValue = '{"Blank":{},"NotNull":{}}';
18+
$expectedvalue = '{"Blank":{},"NotNull":{}}';
19+
20+
$this->transform($originalValue)->shouldBe($expectedvalue);
21+
}
22+
23+
public function it_reverse_transforms_to_constraints_array_format()
24+
{
25+
$originalValue = '{"Blank":{},"NotNull":{}}';
26+
$expectedvalue = [
27+
'Blank' => [],
28+
'NotNull' => [],
29+
];
30+
31+
$this->reverseTransform($originalValue)->shouldBe($expectedvalue);
32+
}
33+
34+
public function it_reverse_transform_null()
35+
{
36+
$originalValue = null;
37+
38+
$this->reverseTransform($originalValue)->shouldBeNull();
39+
}
40+
}

0 commit comments

Comments
 (0)