Skip to content

Commit

Permalink
fix: switch test class from annotations to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaminded committed Mar 17, 2024
1 parent 8167fb9 commit a110597
Showing 1 changed file with 12 additions and 32 deletions.
44 changes: 12 additions & 32 deletions tests/Dynamite/Fixtures/Valid/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,33 @@
declare(strict_types=1);

namespace Dynamite\Fixtures\Valid;
use Dynamite\Configuration as Dynamite;

use Dynamite\Configuration as Dynamite;

/**
* @Dynamite\Item(objectType="USER")
* @Dynamite\PartitionKeyFormat("USER#{id}")
* @Dynamite\SortKeyFormat("USER")
* @Dynamite\DuplicateTo(pk="UDATA#{email}", sk="UDATA", props={"id", "email", "username"})
* @Dynamite\DuplicateTo(pk="UDATA#{username}", sk="UDATA", props={"id", "email", "username"})
*/
#[Dynamite\Item(objectType: "USER")]
#[Dynamite\PartitionKeyFormat("USER#{id}")]
#[Dynamite\SortKeyFormat("USER")]
#[Dynamite\DuplicateTo(pk: "UDATA#{email}", sk: "UDATA", props: ["id", "email", "username"])]
#[Dynamite\DuplicateTo(pk: "UDATA#{username}", sk: "UDATA", props: ["id", "email", "username"])]
class User
{

/**
* @Dynamite\PartitionKey()
* @var string
*/
#[Dynamite\PartitionKey()]
protected string $pk;

/**
* @Dynamite\SortKey()
* @var string
*/
#[Dynamite\SortKey()]
protected string $sk;

/**
* @Dynamite\Attribute(type="string", name="id")
* @var string
*/
#[Dynamite\Attribute(name: "id", type: "string")]
private string $id;

/**
* @Dynamite\Attribute(type="string", name="mail")
* @var string
*/
#[Dynamite\Attribute(name: "mail", type: "string")]
private string $email;

/**
* @Dynamite\Attribute(type="string", name="nick")
* @var string
*/
#[Dynamite\Attribute(name: "nick", type: "string")]
private string $username;

/**
* @Dynamite\Attribute(type="string", name="dnam")
* @var string
*/
#[Dynamite\Attribute(type:"string", name:"dnam")]
private string $usersDogName;


Expand Down

0 comments on commit a110597

Please sign in to comment.