seed(DatabaseSeeder::class); $setRepository = app(SetRepository::class); $elementRepository = app(ElementRepository::class); $baderechSet = $setRepository->find(1); $rootElement = $elementRepository->findRootBySet($baderechSet); $childElements = $elementRepository->findByParentElement($rootElement); $this->assertSame('', $rootElement->getRichText()); $this->assertNull($rootElement->getPdfPath()); $this->assertNull($rootElement->getYoutubeUrl()); $this->assertCount(6, $childElements); $this->assertSame( [ [ 'title' => '1. Introduction', 'description' => 'Your beliefs influence your thinking, ' . 'and your thinking drives your choices. When you ' . 'nurture healthy beliefs - about yourself, about ' . 'the Creator, and about the meaning of life - you ' . 'unlock the ability to live with strength, ' . 'confidence, and hope.', ], [ 'title' => '2. Foundations', 'description' => 'Focal points for thriving in a chaotic ' . 'world. In this fast, complex era, you flourish ' . 'when you develop clarity, well-being, resilience, ' . 'and the ability to uplift the physical world with ' . 'spiritual intention.', ], [ 'title' => '3. Divine Plan', 'description' => 'Understanding the unique greatness of ' . 'our generation and the call to remain hopeful, ' . 'optimistic, and resilient.', ], [ 'title' => '4. Architecture of the Soul', 'description' => "Becoming a Baal Da'at - A Master of " . 'Inner Awareness', ], [ 'title' => '5. Arba Yesodot', 'description' => 'A structured approach to balanced ' . 'living: Physical & Financial Health, ' . 'Relationships, Wisdom and Guidance.', ], [ 'title' => '6. Fluid Integration', 'description' => 'A series of practical exercises to ' . 'engender a shift in mindset, embed healthy ' . 'routines, positive life practices.', ], ], $this->serializeChildElements($childElements), ); $this->assertSame( $this->expectedIntroductionRichText(), $childElements[0]->getRichText(), ); $this->assertSame( '/assets/pdfs/baderech.pdf', $childElements[0]->getPdfPath(), ); $introductionChildElements = $elementRepository->findByParentElement( $childElements[0], ); $this->assertCount(1, $introductionChildElements); $introductionAudioElement = $introductionChildElements[0]; $this->assertSame( 'Fundamentals # 1: Living Our Way to a Wholesome Fulfilled Life ' . '(Audio)', $introductionAudioElement->getTitle(), ); $this->assertSame('', $introductionAudioElement->getDescription()); $this->assertNull($introductionAudioElement->getIconImageUrl()); $this->assertSame('', $introductionAudioElement->getRichText()); $this->assertNull($introductionAudioElement->getPdfPath()); $this->assertSame( 'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s', $introductionAudioElement->getYoutubeUrl(), ); } private function serializeChildElements(array $childElements): array { $serializedChildElements = []; foreach ($childElements as $childElement) { $serializedChildElements[] = [ 'title' => $childElement->getTitle(), 'description' => $childElement->getDescription(), ]; } return $serializedChildElements; } private function expectedIntroductionRichText(): string { return '

' . 'What is Baderech HaAvoda?

' . '

Why We Need a Path of Spiritual Practice

' . "

A 'Baderech HaAvoda' is a way of living - a structured " . 'path for inner and outer growth, spiritual refinement, and ' . 'personal development. It is the art and discipline of knowing ' . 'where to place your attention, how to engage your inner and ' . 'outer world, and how to live the kind of life Hashem designed ' . 'for human beings: a life of wholeness, integration, clarity, ' . 'and joy.

' . '

Throughout Jewish history, our sages taught that no person ' . 'can reach their potential without a derech - a framework that ' . 'provides:

' . '' . '

Baderech HaAvoda answers core human questions:

' . '' . '

Without a derech, people react to life instead of ' . 'responding with wisdom.

' . '

Without a derech, inspiration fades as quickly as it ' . 'comes.

' . '

Without a derech, a person cannot integrate what they ' . 'learn into who they become.

' . '

A Baderech HaAvoda is therefore not a luxury - it is a ' . 'necessity for anyone who wants to live consciously, ' . 'purposefully, and in alignment with their Creator.

' . '

The Challenge of Our Generation

' . '

We live in a time overflowing with information and ' . 'stimulation, yet starving for depth.

' . '

Our generation faces challenges that previous generations ' . 'rarely confronted:

' . '' . '

People today are not taught:

' . '' . '

We have incredible access to knowledge, yet many feel lost ' . '- not for lack of information, but for lack of direction.

' . '

A Baderech HaAvoda gives structure to the soul, it creates ' . 'inner order, and it transforms scattered potential into ' . 'living wisdom. It is a map for living a wholesome, healthy, ' . 'and spiritually aligned life - the life we were created for.' . '

'; } }