Skip to content

Commit b234fd9

Browse files
laylatichygitbutler-client
authored andcommitted
ignore: testing oom
1 parent 1007539 commit b234fd9

1 file changed

Lines changed: 2 additions & 194 deletions

File tree

tests/Integration/Database/Builder/IsDatabaseModelTest.php

Lines changed: 2 additions & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -536,200 +536,8 @@ public function test_query_has_many_with_explicit_attribute(): void
536536
$this->assertContainsOnlyInstancesOf(TestPost::class, $posts);
537537
}
538538

539-
public function test_query_belongs_to_select(): void
540-
{
541-
$this->database->migrate(
542-
CreateMigrationsTable::class,
543-
CreatePublishersTable::class,
544-
CreateAuthorTable::class,
545-
CreateBookTable::class,
546-
);
547-
548-
$author = Author::create(name: 'Target Author', type: AuthorType::A);
549-
$book = Book::create(title: 'Test', author: $author);
550-
551-
$result = $book->query('author')->select()->first();
552-
553-
$this->assertInstanceOf(Author::class, $result);
554-
$this->assertSame('Target Author', $result->name);
555-
}
556-
557-
public function test_query_belongs_to_count(): void
558-
{
559-
$this->database->migrate(
560-
CreateMigrationsTable::class,
561-
CreatePublishersTable::class,
562-
CreateAuthorTable::class,
563-
CreateBookTable::class,
564-
);
565-
566-
$author = Author::create(name: 'Author', type: AuthorType::A);
567-
$book = Book::create(title: 'Test', author: $author);
568-
569-
$this->assertSame(1, $book->query('author')->count()->execute());
570-
}
571-
572-
public function test_query_has_one_select(): void
573-
{
574-
$this->database->migrate(
575-
CreateMigrationsTable::class,
576-
CreatePublishersTable::class,
577-
CreateAuthorTable::class,
578-
CreateBookTable::class,
579-
CreateIsbnTable::class,
580-
);
581-
582-
$book = Book::create(title: 'Test Book');
583-
Isbn::new(value: '978-123', book: $book)->save();
584-
585-
$result = $book->query('isbn')->select()->first();
586-
587-
$this->assertInstanceOf(Isbn::class, $result);
588-
$this->assertSame('978-123', $result->value);
589-
}
590-
591-
public function test_query_has_one_count(): void
592-
{
593-
$this->database->migrate(
594-
CreateMigrationsTable::class,
595-
CreatePublishersTable::class,
596-
CreateAuthorTable::class,
597-
CreateBookTable::class,
598-
CreateIsbnTable::class,
599-
);
600-
601-
$book = Book::create(title: 'Test Book');
602-
Isbn::new(value: '978-123', book: $book)->save();
603-
604-
$this->assertSame(1, $book->query('isbn')->count()->execute());
605-
}
606-
607-
public function test_query_has_one_update(): void
608-
{
609-
$this->database->migrate(
610-
CreateMigrationsTable::class,
611-
CreatePublishersTable::class,
612-
CreateAuthorTable::class,
613-
CreateBookTable::class,
614-
CreateIsbnTable::class,
615-
);
616-
617-
$bookA = Book::create(title: 'Book A');
618-
$bookB = Book::create(title: 'Book B');
619-
Isbn::new(value: 'old-isbn', book: $bookA)->save();
620-
Isbn::new(value: 'keep-isbn', book: $bookB)->save();
621-
622-
$bookA->query('isbn')->update(value: 'new-isbn')->execute();
623-
624-
$isbnA = $bookA->query('isbn')->select()->first();
625-
$isbnB = $bookB->query('isbn')->select()->first();
626-
627-
$this->assertSame('new-isbn', $isbnA->value);
628-
$this->assertSame('keep-isbn', $isbnB->value);
629-
}
630-
631-
public function test_query_has_one_delete(): void
632-
{
633-
$this->database->migrate(
634-
CreateMigrationsTable::class,
635-
CreatePublishersTable::class,
636-
CreateAuthorTable::class,
637-
CreateBookTable::class,
638-
CreateIsbnTable::class,
639-
);
640-
641-
$bookA = Book::create(title: 'Book A');
642-
$bookB = Book::create(title: 'Book B');
643-
Isbn::new(value: 'isbn-a', book: $bookA)->save();
644-
Isbn::new(value: 'isbn-b', book: $bookB)->save();
645-
646-
$bookA->query('isbn')->delete()->execute();
647-
648-
$this->assertSame(0, $bookA->query('isbn')->count()->execute());
649-
$this->assertSame(1, $bookB->query('isbn')->count()->execute());
650-
}
651-
652-
public function test_query_has_one_through_select(): void
653-
{
654-
$this->database->migrate(
655-
CreateMigrationsTable::class,
656-
CreateTagTable::class,
657-
CreateBookReviewTable::class,
658-
CreateReviewerTable::class,
659-
);
660-
661-
$tag = Tag::create(label: 'fantasy');
662-
$review = BookReview::create(content: 'Great', tag: $tag);
663-
Reviewer::create(name: 'Alice', bookReview: $review);
664-
665-
$result = $tag->query('topReviewer')->select()->first();
666-
667-
$this->assertInstanceOf(Reviewer::class, $result);
668-
$this->assertSame('Alice', $result->name);
669-
}
670-
671-
public function test_query_has_one_through_count(): void
672-
{
673-
$this->database->migrate(
674-
CreateMigrationsTable::class,
675-
CreateTagTable::class,
676-
CreateBookReviewTable::class,
677-
CreateReviewerTable::class,
678-
);
679-
680-
$tag = Tag::create(label: 'fantasy');
681-
$review = BookReview::create(content: 'Great', tag: $tag);
682-
Reviewer::create(name: 'Alice', bookReview: $review);
683-
684-
$this->assertSame(1, $tag->query('topReviewer')->count()->execute());
685-
}
686-
687-
public function test_query_has_one_through_update(): void
688-
{
689-
$this->database->migrate(
690-
CreateMigrationsTable::class,
691-
CreateTagTable::class,
692-
CreateBookReviewTable::class,
693-
CreateReviewerTable::class,
694-
);
695-
696-
$tagA = Tag::create(label: 'fantasy');
697-
$tagB = Tag::create(label: 'sci-fi');
698-
$reviewA = BookReview::create(content: 'Great', tag: $tagA);
699-
$reviewB = BookReview::create(content: 'Meh', tag: $tagB);
700-
Reviewer::create(name: 'Alice', bookReview: $reviewA);
701-
Reviewer::create(name: 'Bob', bookReview: $reviewB);
702-
703-
$tagA->query('topReviewer')->update(name: 'Updated')->execute();
704-
705-
$resultA = $tagA->query('topReviewer')->select()->first();
706-
$resultB = $tagB->query('topReviewer')->select()->first();
707-
708-
$this->assertSame('Updated', $resultA->name);
709-
$this->assertSame('Bob', $resultB->name);
710-
}
711-
712-
public function test_query_has_one_through_delete(): void
713-
{
714-
$this->database->migrate(
715-
CreateMigrationsTable::class,
716-
CreateTagTable::class,
717-
CreateBookReviewTable::class,
718-
CreateReviewerTable::class,
719-
);
720-
721-
$tagA = Tag::create(label: 'fantasy');
722-
$tagB = Tag::create(label: 'sci-fi');
723-
$reviewA = BookReview::create(content: 'Great', tag: $tagA);
724-
$reviewB = BookReview::create(content: 'Meh', tag: $tagB);
725-
Reviewer::create(name: 'Alice', bookReview: $reviewA);
726-
Reviewer::create(name: 'Bob', bookReview: $reviewB);
727-
728-
$tagA->query('topReviewer')->delete()->execute();
729-
730-
$this->assertSame(0, $tagA->query('topReviewer')->count()->execute());
731-
$this->assertSame(1, $tagB->query('topReviewer')->count()->execute());
732-
}
539+
// BelongsTo, HasOne, HasOneThrough tests temporarily commented out for CI memory investigation
540+
// See: https://github.com/tempestphp/tempest-framework/pull/2102
733541

734542
public function test_query_has_many_with_where_has(): void
735543
{

0 commit comments

Comments
 (0)