Skip to content

Commit 8d0e65a

Browse files
committed
chore: fix links in README
1 parent aafc109 commit 8d0e65a

File tree

1 file changed

+6
-81
lines changed

1 file changed

+6
-81
lines changed

README.md

Lines changed: 6 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 🐳 Test-Containers for Quick Magento Development
22
[![Docker Build](https://github.com/EcomDev/testcontainer-magento-data/actions/workflows/docker-images.yml/badge.svg)](https://github.com/EcomDev/testcontainer-magento-data/actions/workflows/docker-images.yml)
3-
[![PHP Package](https://github.com/EcomDev/testcontainer-magento-data/actions/workflows/php-package.yml/badge.svg)](https://github.com/EcomDev/testcontainer-magento-data/actions/workflows/php-package.yml)
3+
[![PHP Package](https://github.com/EcomDev/testcontainer-magento-data-php/actions/workflows/php-package.yml/badge.svg)](https://github.com/EcomDev/testcontainer-magento-data-php/actions/workflows/php-package.yml)
4+
[![Rust Package](https://github.com/EcomDev/testcontainer-magento-data-rust/actions/workflows/rust-package.yml/badge.svg)](https://github.com/EcomDev/testcontainer-magento-data-rust/actions/workflows/rust-package.yml)
45

56
This package simplifies the process of automated testing with real database and search engine
67

@@ -37,87 +38,11 @@ With the following `IMAGE_NAME` variations:
3738
- `mariadb` - Pre-populated MariaDB database container with relevant Magento schema and data
3839
- `opensearch` - Pre-populated OpenSearch container with relevant Magento indexes based on db data
3940

40-
## Usage in PHP
41+
## Prebuild Packages
4142

42-
### MySQL container
43-
44-
Create Latest Magento Database Build
45-
```php
46-
use EcomDev\TestContainers\MagentoData\DbContainerBuilder;
47-
48-
$container = DbContainerBuilder::mysql()
49-
->build();
50-
```
51-
52-
Create Latest Magento Database Build with sample data
53-
```php
54-
use EcomDev\TestContainers\MagentoData\DbContainerBuilder;
55-
56-
$container = DbContainerBuilder::mysql()
57-
->withSampleData()
58-
->build();
59-
```
60-
61-
Create 2.4.7-p2 with sample data and fetch number of products
62-
```php
63-
use EcomDev\TestContainers\MagentoData\DbContainerBuilder;
64-
use PDO;
65-
66-
$container = DbContainerBuilder::mysql()
67-
->withMagentoVersion('2.4.7-p2')
68-
->withSampleData()
69-
->build();
70-
71-
$connectionSettings = $container->getConnectionSettings();
72-
$connection = new PDO(
73-
$connectionSettings->dsn(),
74-
$connectionSettings->user,
75-
$connectionSettings->password
76-
);
77-
78-
$result = $connection->query('SELECT COUNT(*) FROM catalog_product_entity');
79-
// Outputs 2040
80-
echo $result->fetch(PDO::FETCH_COLUMN);
81-
```
82-
83-
### MariaDB container
84-
Everything the same as for MySQL container, just a different builder method
85-
86-
```php
87-
use EcomDev\TestContainers\MagentoData\DbContainerBuilder;
88-
89-
$container = DbContainerBuilder::mariadb()
90-
->withMagentoVersion('2.4.7-p2')
91-
->withSampleData()
92-
->build();
93-
```
94-
95-
## OpenSearch container
96-
97-
For OpenSearch container there is a different builder and container, that allows building base url for http connection
98-
99-
Here is a small example
100-
101-
```php
102-
use EcomDev\TestContainers\MagentoData\OpenSearchContainerBuilder;
103-
use GuzzleHttp\Client;
104-
105-
$container = OpenSearchContainerBuilder::new()
106-
->withSampleData()
107-
->build();
108-
109-
$client = new Client([
110-
'base_uri' => $container->getBaseUrl()
111-
]);
112-
113-
$result = json_decode(
114-
$client->get('magento2_product_1/_count')->getBody()->getContents(),
115-
true
116-
);
117-
118-
// Outputs 181
119-
echo $result['count'];
120-
```
43+
Packages available in the following languages to streamline usage of the Magento data image:
44+
- [ecomdev/testcontainers-magento-data](`https://github.com/EcomDev/testcontainer-magento-data-php`) composer package in PHP
45+
- [testcontainers-magento-data](`https://github.com/EcomDev/testcontainer-magento-data-rust`) cargo crate in Rust
12146

12247
## 📜 License
12348

0 commit comments

Comments
 (0)